src/ShopRatingServiceBundle/objects/db/TPkgShopRatingService.class.php
protected function UpdateMainScroeValue()
    {
        $bRet = false;
        $sQuery = " SELECT AVG( `score` ) AS main_score FROM `pkg_shop_rating_service_rating` WHERE `pkg_shop_rating_service_id` = '".$this->id."' ";
        $rs = MySqlLegacySupport::getInstance()->query($sQuery);
        if ($rs) {
            $oAVG = MySqlLegacySupport::getInstance()->fetch_object($rs);
        }

        //Update value
        if ($oAVG->main_score > 0) {
            $sQuery = "UPDATE pkg_shop_rating_service SET current_rating = '".$oAVG->main_score."', current_rating_date = NOW() WHERE id = '".$this->id."' ";
            MySqlLegacySupport::getInstance()->query($sQuery);
            $bRet = $oAVG->main_score;
        }

        return $bRet;
    }
protected function UpdateMainScroeValue()
    {
        $bRet = false;
        $sQuery = " SELECT AVG( `score` ) AS main_score FROM `pkg_shop_rating_service_rating` WHERE `pkg_shop_rating_service_id` = '".$this->id."' ";
        $rs = MySqlLegacySupport::getInstance()->query($sQuery);
        if ($rs) {
            $oAVG = MySqlLegacySupport::getInstance()->fetch_object($rs);
        }

        //Update value
        if ($oAVG->main_score > 0) {
            $sQuery = "UPDATE pkg_shop_rating_service SET current_rating = '".$oAVG->main_score."', current_rating_date = NOW() WHERE id = '".$this->id."' ";
            MySqlLegacySupport::getInstance()->query($sQuery);
            $bRet = $oAVG->main_score;
        }

        return $bRet;
    }
protected function UpdateMainScroeValue ( ) { $ bRet = false ; $ sQuery = " SELECT AVG( `score` ) AS main_score FROM `pkg_shop_rating_service_rating` WHERE `pkg_shop_rating_service_id` = '" . $ this -> id . "' " ; $ rs = MySqlLegacySupport :: getInstance ( ) -> query ( $ sQuery ) ; if ( $ rs ) { $ oAVG = MySqlLegacySupport :: getInstance ( ) -> fetch_object ( $ rs ) ; } //Update value if ( $ oAVG -> main_score > 0 ) { $ sQuery = "UPDATE pkg_shop_rating_service SET current_rating = '" . $ oAVG -> main_score . "', current_rating_date = NOW() WHERE id = '" . $ this -> id . "' " ; MySqlLegacySupport :: getInstance ( ) -> query ( $ sQuery ) ; $ bRet = $ oAVG -> main_score ; } return $ bRet ; }
Update main score value of rating service - calculated from `pkg_shop_rating_service_rating`.`score`.

@return bool
Update main score value of rating service - calculated from pkg_shop_rating_service_rating . score .