@param Review $object

@return array
773887
public function getData($object)
    {
        return [
            'OXID'          => $object->getId(),
            'OXRATING'      => $object->getRating(),
            'OXTEXT'        => $object->getText(),
            'OXOBJECTID'    => $object->getObjectId(),
            'OXUSERID'      => $object->getUserId(),
            'OXTYPE'        => $object->getType(),
            'OXTIMESTAMP'   => $object->getCreatedAt(),
        ];
    }
716694
protected function parseToArray($object): array
    {
        if (!is_array($object)) {
            $attributes = method_exists($object, 'getAttributes')
                ? $object->getAttributes()
                : get_object_vars($object);

            return $attributes;
        }

        return $object;
    }
962059
private function getObjectState($object)
    {
        $class = new \ReflectionClass($object);
        $visibility = \ReflectionProperty::IS_PRIVATE | \ReflectionProperty::IS_PROTECTED;
        $values = [];

        do {
            foreach ($class->getProperties($visibility) as $property) {
                $property->setAccessible(true);
                $values[$property->getName()] = $property->getValue($object);
            }

            $class = $class->getParentClass();
            $visibility = \ReflectionProperty::IS_PRIVATE;
        } while ($class);

        return get_object_vars($object) + $values;
    }
1130061
public static function getLabels($object)
    {
        $labels    = null;
        $labelsRaw = $object->getDataValue('stitky');

        if (strlen($labelsRaw)) {
            $labels = is_array($labelsRaw) ? $labelsRaw : self::listToArray($labelsRaw);
        }
        return $labels;
    }
1238564
public function normalize($object, $format = null, array $context = []): array
    {
        $normalizedItems = [];

        foreach ($object as $item) {
            $normalizedItems[] = $this->normalizer->normalize($item, $format, $context);
        }

        $normalizedRelations = $this->normalizer->normalize($object->getRelations(), $format, $context);

        return [
            'state'     => [
                'page'   => $object->getPage(),
                'limit'  => $object->getLimit(),
                'pages'  => (int) (ceil($object->getTotal() / $object->getLimit())),
                'total'  => $object->getTotal(),
                '_links' => $normalizedRelations,
            ],
            '_embedded' => [
                'items' => $normalizedItems,
            ],
        ];
    }
480938
public function extract($object)
    {
        $data = parent::extract($object);
        $data['description-description']    = $this->extractValue('descriptiondescription', $object);
        $data['description-requirements']   = $this->extractValue('descriptionrequirements', $object);
        $data['description-benefits']       = $this->extractValue('descriptionbenefits', $object);
        $data['description-qualifications'] = $this->extractValue('descriptionqualifications', $object);
        $data['description-title']          = $this->extractValue('descriptiontitle', $object);

        $data['description-html']           = $object->getTemplateValues()->getHtml();
        return $data;
    }
1176038
private function getObjectModel($type)
    {
        if ($type === 'oxarticle') {
            $model = oxNew(Article::class);
        }

        if ($type === 'oxrecommlist') {
            $model = oxNew(RecommendationList::class);
        }

        if (!isset($model)) {
            throw new ReviewAndRatingObjectTypeException();
        }

        return $model;
    }
554998
public function reviews()
    {
        if (is_null($this->reviewRequests)) {
            $this->reviewRequests = new ReviewRequests($this->client);
        }

        return $this->reviewRequests;
    }
1076775
public function toItem($object): Item
    {
        /**
         * @var Comment $object
         */
        return Item::create(
            $this->toItemUUID($object),
            [
                'parent' => $object->getParent() instanceof Comment
                    ? $object
                        ->getParent()
                        ->getId()
                    : null,
                'author_name' => $object->getAuthorName(),
                'author_email' => $object->getAuthorEmail(),
                'author_avatar' => $object->getAuthorAvatar(),
                'author_role' => $object->getAuthorRole(),
                'content' => $object->getContent(),
            ],
            [
                'author_uuid' => $object->getAuthorUUID(),
                'thumb' => $object->getThumb(),
                'source' => $object->getSource(),
                'state' => $object->getState(),
                'rating' => $object->getRating(),
                'created_at' => $object->getCreatedAt()->format(DATE_ATOM),
            ],
            [
                $object->getContent()
            ]
        );
    }
1213617
public static function readAttributes($object)
    {
        // Bail out if a non-object was passed.
        if (!is_object($object)) {
            throw self::getInvalidArgumentException(1, 'object');
        }

        $reflector = new ReflectionObject($object);
        $result    = [];

        // Iterate over the attributes of the object.
        foreach ($reflector->getProperties() as $attribute) {
            $attribute->setAccessible(true);
            $result[$attribute->getName()] = $attribute->getValue($object);
        }

        return $result;
    }
423868
public function collect($object)
    {
        $result = array();
        $products = $object->getItems();
        foreach ($products as $product) {
            $result[] = $product;
        }
        return $result;
    }
956953
protected function getHintFromObject($object)
    {
        if (!is_object($object)) {
            return array();
        }

        $class = get_class($object);
        $type = array_search($class, $this->types);

        if ($type) {
            return array('@type' => $type);
        }

        return  array('@class' => $class);
    }
38802
public function extract($object)
    {
        $pdfConverterHydrator = new PdfConverterHydrator();

        return [
            'responseStatus' => $object->getResponseStatus(),
            'sourceContainer' => $pdfConverterHydrator->extract($object->getSourceContainer()),
            'url' => $object->getUrl(),
        ];
    }
173886
public function methods($object)
    {
        $methods = (new ReflectionClass($object))->getMethods(ReflectionMethod::IS_PUBLIC);

        $iterator = function(ReflectionMethod $method)
        {
            return $method->getName();
        };

        return array_map($iterator, $methods);
    }
458542
private function getReviewDataWithRating(ArrayCollection $reviews, ArrayCollection $ratings)
    {
        $reviewList = [];

        foreach ($reviews as $review) {
            $ratingAndReview = [
                'reviewId'      => $review->getId(),
                'text'          => $review->getText(),
                'createdAt'     => $review->getCreatedAt(),
                'objectId'      => $review->getObjectId(),
                'objectType'    => $review->getType(),
                'rating'        => false,
                'ratingId'      => false,
            ];

            foreach ($ratings as $rating) {
                if ($this->isReviewRating($review, $rating)) {
                    $ratingAndReview['rating'] = $rating->getRating();
                    $ratingAndReview['ratingId'] = $rating->getId();

                    break;
                }
            }

            $reviewList[] = $ratingAndReview;
        }

        return $reviewList;
    }
341926
public function getPropertyValuesArray($object)
    {
        $values = [];
        foreach ($this->entityPropertiesMetadata as $entityPropertyMetadata) {
            $v = $entityPropertyMetadata->getValue($object);
            if (is_object($v)) {
                switch (get_class($v)) {
                    case \DateTime::class:
                        $v = $v->getTimestamp();
                        break;
                }
            }
            $values[$entityPropertyMetadata->getPropertyName()] = $v;
        }

        return $values;
    }
545815
private function mapReviewAndRatingList($reviewAndRatingDataList)
    {
        $mappedReviewAndRating = new ArrayCollection();

        foreach ($reviewAndRatingDataList as $reviewAndRatingData) {
            $mappedReviewAndRating[] = $this->mapReviewAndRating($reviewAndRatingData);
        }

        return $mappedReviewAndRating;
    }