Model/Sync/Review.php
public function _exportReviewsForWebsite(\Magento\Store\Model\Website $website)
    {
        $limit           = $this->helper->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT,
            $website
        );
        $emailReviews    = $this->_getReviewsToExport($website, $limit);
        $this->reviewIds = [];

        if ($emailReviews->getSize()) {
            $ids = $emailReviews->getColumnValues('review_id');
            $reviewResourceFactory = $this->reviewResourceFactory->create();
            $reviews = $reviewResourceFactory->getMageReviewsByIds($ids);

            foreach ($reviews as $mageReview) {
                try {
                    $product = $reviewResourceFactory
                        ->getProductByIdAndStore($mageReview->getEntityPkValue(), $mageReview->getStoreId());

                    $connectorReview = $this->connectorReviewFactory->create()
                        ->setReviewData($mageReview)
                        ->setProduct($product);

                    $votesCollection = $reviewResourceFactory
                        ->getVoteCollectionByReview($mageReview->getReviewId());

                    foreach ($votesCollection as $ratingItem) {
                        $rating = $this->ratingFactory->create()
                            ->setRating($ratingItem);
                        $connectorReview->createRating(
                            $ratingItem->getRatingCode(),
                            $rating
                        );
                    }
                    $this->reviews[$website->getId()][] = $connectorReview->expose();
                    $this->reviewIds[]                  = $mageReview->getReviewId();
                } catch (\Exception $e) {
                    $this->helper->debug((string)$e, []);
                }
            }
        }
    }
public function _exportReviewsForWebsite(\Magento\Store\Model\Website $website)
    {
        $limit           = $this->helper->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT,
            $website
        );
        $emailReviews    = $this->_getReviewsToExport($website, $limit);
        $this->reviewIds = [];

        if ($emailReviews->getSize()) {
            $ids = $emailReviews->getColumnValues('review_id');
            $reviewResourceFactory = $this->reviewResourceFactory->create();
            $reviews = $reviewResourceFactory->getMageReviewsByIds($ids);

            foreach ($reviews as $mageReview) {
                try {
                    $product = $reviewResourceFactory
                        ->getProductByIdAndStore($mageReview->getEntityPkValue(), $mageReview->getStoreId());

                    $connectorReview = $this->connectorReviewFactory->create()
                        ->setReviewData($mageReview)
                        ->setProduct($product);

                    $votesCollection = $reviewResourceFactory
                        ->getVoteCollectionByReview($mageReview->getReviewId());

                    foreach ($votesCollection as $ratingItem) {
                        $rating = $this->ratingFactory->create()
                            ->setRating($ratingItem);
                        $connectorReview->createRating(
                            $ratingItem->getRatingCode(),
                            $rating
                        );
                    }
                    $this->reviews[$website->getId()][] = $connectorReview->expose();
                    $this->reviewIds[]                  = $mageReview->getReviewId();
                } catch (\Exception $e) {
                    $this->helper->debug((string)$e, []);
                }
            }
        }
    }
public function _exportReviewsForWebsite ( \ Magento \ Store \ Model \ Website $ website ) { $ limit = $ this -> helper -> getWebsiteConfig ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT , $ website ) ; $ emailReviews = $ this -> _getReviewsToExport ( $ website , $ limit ) ; $ this -> reviewIds = [ ] ; if ( $ emailReviews -> getSize ( ) ) { $ ids = $ emailReviews -> getColumnValues ( 'review_id' ) ; $ reviewResourceFactory = $ this -> reviewResourceFactory -> create ( ) ; $ reviews = $ reviewResourceFactory -> getMageReviewsByIds ( $ ids ) ; foreach ( $ reviews as $ mageReview ) { try { $ product = $ reviewResourceFactory -> getProductByIdAndStore ( $ mageReview -> getEntityPkValue ( ) , $ mageReview -> getStoreId ( ) ) ; $ connectorReview = $ this -> connectorReviewFactory -> create ( ) -> setReviewData ( $ mageReview ) -> setProduct ( $ product ) ; $ votesCollection = $ reviewResourceFactory -> getVoteCollectionByReview ( $ mageReview -> getReviewId ( ) ) ; foreach ( $ votesCollection as $ ratingItem ) { $ rating = $ this -> ratingFactory -> create ( ) -> setRating ( $ ratingItem ) ; $ connectorReview -> createRating ( $ ratingItem -> getRatingCode ( ) , $ rating ) ; } $ this -> reviews [ $ website -> getId ( ) ] [ ] = $ connectorReview -> expose ( ) ; $ this -> reviewIds [ ] = $ mageReview -> getReviewId ( ) ; } catch ( \ Exception $ e ) { $ this -> helper -> debug ( ( string ) $ e , [ ] ) ; } } } }
Export reviews for website.

@param \Magento\Store\Model\Website $website

@return null
Export reviews for website .