Maps Reviews and Ratings data to Collection of ReviewAndRating view objects.

@param array $reviewAndRatingDataList

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

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

        return $mappedReviewAndRating;
    }
1044843
public function ReviewItemsEditable() {
		$reviewItems = $this->ReviewItems();
		if (!$reviewItems) {
			return;
		}
		$result = array();
		foreach ($reviewItems as $page)
		{
			if ($page && $page->_canEdit)
			{
				$result[] = $page;
			}
		}
		$result = new ArrayList($result);
		$result = $result->sort(array(
			'_CurrentActionSort' => 'DESC',
		));
		return $result;
	}
1126423
public function mergeArray(array $arr): DataMap
    {
        $this->data = array_merge($this->data, $arr);
        return $this;
    }
1270674
public function update($review_id, array $data)
    {
        $result = null;
        $this->hook->attach('review.update.before', $review_id, $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $data['modified'] = GC_TIME;
        $result = $this->db->update('review', $data, array('review_id' => $review_id));
        $this->hook->attach('review.update.after', $review_id, $data, $result, $this);
        return (bool) $result;
    }
419793
private function prepareRatingAndReviewPropertiesData($reviewAndRatingList)
    {
        foreach ($reviewAndRatingList as $reviewAndRating) {
            $this->setObjectTitleToReviewAndRating($reviewAndRating);
            $this->formatReviewText($reviewAndRating);
            $this->formatReviewAndRatingDate($reviewAndRating);
        }
    }
663220
public function getReviews()
    {
        $oReview = oxNew(\OxidEsales\Eshop\Application\Model\Review::class);
        $oRevs = $oReview->loadList('oxrecommlist', $this->getId());
        //if no review found, return null
        if ($oRevs->count() < 1) {
            return null;
        }

        return $oRevs;
    }
573967
public static function fromParser(ReviewerParser $parser): AnimeReviewer
    {
        $instance = new self();

        $instance->url= $parser->getUrl();
        $instance->imageUrl = $parser->getImageUrl();
        $instance->username = $parser->getUsername();
        $instance->episodesSeen = $parser->getEpisodesSeen();
        $instance->scores = $parser->getAnimeScores();

        return $instance;
    }
671954
public function getSimilarRecommLists()
    {
        $aArticleIds = $this->getViewParameter("aArticleIds");

        $oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);

        return $oRecommList->getRecommListsByIds($aArticleIds);
    }
287275
private function isReviewRating(Review $review, Rating $rating)
    {
        return $rating->getType() === $review->getType()
            && $rating->getObjectId() === $review->getObjectId()
            && $rating->getRating() === $review->getRating()
            && $rating->getUserId() === $review->getUserId();
    }
837429
public function mergeReviewAndRating(ArrayCollection $reviews, ArrayCollection $ratings)
    {
        $ratingAndReviewList = array_merge(
            $this->getReviewDataWithRating($reviews, $ratings),
            $this->getRatingWithoutReviewData($reviews, $ratings)
        );

        return $this->mapReviewAndRatingList($ratingAndReviewList);
    }
874934
public function getVoteCollectionByReview($reviewId)
    {
        $votesCollection = $this->voteCollection->create()
            ->setReviewFilter($reviewId);

        $votesCollection->getSelect()->join(
            ['rating' => $this->getTable('rating')],
            'rating.rating_id = main_table.rating_id',
            ['rating_code' => 'rating.rating_code']
        );

        return $votesCollection;
    }
268022
public function getDraftCollectionAction()
    {
        $contents = $this->getEntityManager()
            ->getRepository('BackBee\ClassContent\Revision')
            ->getAllDrafts($this->getApplication()->getBBUserToken())
        ;

        $contents = $this->sortDraftCollection($contents);

        return $this->addContentRangeHeadersToResponse($this->createJsonResponse($contents), $contents, 0);
    }
929291
public static function getActionValidateAnnotationData($objectManager)
    {
        $reflectionService = $objectManager->get(ReflectionService::class);

        $result = [];

        $className = get_called_class();
        $methodNames = get_class_methods($className);
        foreach ($methodNames as $methodName) {
            if (strlen($methodName) > 6 && strpos($methodName, 'Action', strlen($methodName) - 6) !== false) {
                $validateAnnotations = $reflectionService->getMethodAnnotations($className, $methodName, Flow\Validate::class);
                $result[$methodName] = array_map(function ($validateAnnotation) {
                    return [
                        'type' => $validateAnnotation->type,
                        'options' => $validateAnnotation->options,
                        'argumentName' => $validateAnnotation->argumentName,
                    ];
                }, $validateAnnotations);
            }
        }

        return $result;
    }
420229
public static function hydrateCollection(array $reviews)
    {
        $hydrated = [];

        foreach ($reviews as $review) {
            $hydrated[] = self::hydrate($review);
        }

        return $hydrated;
    }
524467
public function doReview($data) {
		$id = isset($data['ID']) ? (int)$data['ID'] : null;
		if (!$id) {
			user_error('Invalid ID passed for review action');
			$this->redirectBack();
		}
		return $this->owner->redirect(Controller::join_links($this->owner->Link('review'), $id));
	}
959389
private function getMergedReviewAndRatingList($userId)
    {
        $reviews = $this->userReviewService->getReviews($userId);
        $ratings = $this->userRatingService->getRatings($userId);

        return $this
            ->reviewAndRatingMergingService
            ->mergeReviewAndRating($reviews, $ratings);
    }
617365
public function getReviews()
    {
        if ($this->_aReviews === null) {
            $this->_aReviews = false;
            if ($this->isReviewActive() && ($oActiveRecommList = $this->getActiveRecommList())) {
                $this->_aReviews = $oActiveRecommList->getReviews();
            }
        }

        return $this->_aReviews;
    }