src/ShopBundle/mappers/article/TPkgShopMapper_ArticleRatingOverview.class.php
protected function GetRatingOverview($oReviewModuleConfiguration, $oArticle, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled)
    {
        $aRatingOverview = array();
        for ($i = $oReviewModuleConfiguration->fieldRatingCount; $i > 0; --$i) {
            $aRatingOverview['r_'.$i] = array();
            $aRatingOverview['r_'.$i]['dRating'] = $i;
            $aRatingOverview['r_'.$i]['iRatingCount'] = 0;
        }
        $oReviewList = $oArticle->GetReviewsPublished();
        while ($oReview = $oReviewList->Next()) {
            if ($bCachingEnabled) {
                $oCacheTriggerManager->addTrigger($oReview->table, $oReview->id);
            }
            if (isset($aRatingOverview['r_'.$oReview->fieldRating])) {
                $aRatingOverview['r_'.$oReview->fieldRating];
                ++$aRatingOverview['r_'.$oReview->fieldRating]['iRatingCount'];
            }
        }

        return $aRatingOverview;
    }
protected function GetRatingOverview($oReviewModuleConfiguration, $oArticle, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled)
    {
        $aRatingOverview = array();
        for ($i = $oReviewModuleConfiguration->fieldRatingCount; $i > 0; --$i) {
            $aRatingOverview['r_'.$i] = array();
            $aRatingOverview['r_'.$i]['dRating'] = $i;
            $aRatingOverview['r_'.$i]['iRatingCount'] = 0;
        }
        $oReviewList = $oArticle->GetReviewsPublished();
        while ($oReview = $oReviewList->Next()) {
            if ($bCachingEnabled) {
                $oCacheTriggerManager->addTrigger($oReview->table, $oReview->id);
            }
            if (isset($aRatingOverview['r_'.$oReview->fieldRating])) {
                $aRatingOverview['r_'.$oReview->fieldRating];
                ++$aRatingOverview['r_'.$oReview->fieldRating]['iRatingCount'];
            }
        }

        return $aRatingOverview;
    }
protected function GetRatingOverview ( $ oReviewModuleConfiguration , $ oArticle , IMapperCacheTriggerRestricted $ oCacheTriggerManager , $ bCachingEnabled ) { $ aRatingOverview = array ( ) ; for ( $ i = $ oReviewModuleConfiguration -> fieldRatingCount ; $ i > 0 ; -- $ i ) { $ aRatingOverview [ 'r_' . $ i ] = array ( ) ; $ aRatingOverview [ 'r_' . $ i ] [ 'dRating' ] = $ i ; $ aRatingOverview [ 'r_' . $ i ] [ 'iRatingCount' ] = 0 ; } $ oReviewList = $ oArticle -> GetReviewsPublished ( ) ; while ( $ oReview = $ oReviewList -> Next ( ) ) { if ( $ bCachingEnabled ) { $ oCacheTriggerManager -> addTrigger ( $ oReview -> table , $ oReview -> id ) ; } if ( isset ( $ aRatingOverview [ 'r_' . $ oReview -> fieldRating ] ) ) { $ aRatingOverview [ 'r_' . $ oReview -> fieldRating ] ; ++ $ aRatingOverview [ 'r_' . $ oReview -> fieldRating ] [ 'iRatingCount' ] ; } } return $ aRatingOverview ; }
Get array for each rating count holding the count of rated reviews.

@param TdbPkgShopArticleReviewModuleShopArticleReviewConfiguration $oReviewModuleConfiguration
@param TdbShopArticle                                              $oArticle
@param \IMapperCacheTriggerRestricted                              $oCacheTriggerManager

@return array
Get array for each rating count holding the count of rated reviews .