![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-review-graph-ql/Mapper/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\ReviewGraphQl\Mapper; use Magento\Catalog\Model\Product; use Magento\Review\Model\Review; /** * Converts the review data from review object to an associative array */ class ReviewDataMapper { /** * Mapping the review data * * @param Review $review * * @return array */ public function map(Review $review): array { return [ 'summary' => $review->getData('title'), 'text' => $review->getData('detail'), 'nickname' => $review->getData('nickname'), 'created_at' => $review->getData('created_at'), 'sku' => $review->getSku(), 'model' => $review ]; } }