src/ShopRatingServiceBundle/objects/cronjobs/TPkgShopRating_CronJob_SendRatingMails.class.php
protected function CleanupAffiliateCode($sAffiliateCode)
    {
        $sRet = '';
        $sAffiliateCode = trim($sAffiliateCode);
        if (!empty($sAffiliateCode)) {
            //get all rating services
            $sQuery = "  SELECT *
                       FROM `pkg_shop_rating_service`
                      WHERE `active` = '1'
                   ORDER BY `position`,`weight`  ASC
                  ";
            $oRatingServiceList = TdbPkgShopRatingServiceList::GetList($sQuery);
            $oRatingServiceList->GoToStart();

            //loop and try to identify one...
            while ($oService = $oRatingServiceList->Next()) {
                /* @var $oService TdbPkgShopRatingService */
                $pos = strpos($sAffiliateCode, strtolower(trim($oService->fieldAffiliateValue)));
                if (false !== $pos) {
                    //service found!
                    $oRatingServiceList->GoToEnd();
                    $sRet = $oService->fieldAffiliateValue;
                }
            }
        }

        return $sRet;
    }
protected function CleanupAffiliateCode($sAffiliateCode)
    {
        $sRet = '';
        $sAffiliateCode = trim($sAffiliateCode);
        if (!empty($sAffiliateCode)) {
            //get all rating services
            $sQuery = "  SELECT *
                       FROM `pkg_shop_rating_service`
                      WHERE `active` = '1'
                   ORDER BY `position`,`weight`  ASC
                  ";
            $oRatingServiceList = TdbPkgShopRatingServiceList::GetList($sQuery);
            $oRatingServiceList->GoToStart();

            //loop and try to identify one...
            while ($oService = $oRatingServiceList->Next()) {
                /* @var $oService TdbPkgShopRatingService */
                $pos = strpos($sAffiliateCode, strtolower(trim($oService->fieldAffiliateValue)));
                if (false !== $pos) {
                    //service found!
                    $oRatingServiceList->GoToEnd();
                    $sRet = $oService->fieldAffiliateValue;
                }
            }
        }

        return $sRet;
    }
protected function CleanupAffiliateCode ( $ sAffiliateCode ) { $ sRet = '' ; $ sAffiliateCode = trim ( $ sAffiliateCode ) ; if ( ! empty ( $ sAffiliateCode ) ) { //get all rating services $ sQuery = "  SELECT *
                       FROM `pkg_shop_rating_service`
                      WHERE `active` = '1'
                   ORDER BY `position`,`weight`  ASC
                  " ; $ oRatingServiceList = TdbPkgShopRatingServiceList :: GetList ( $ sQuery ) ; $ oRatingServiceList -> GoToStart ( ) ; //loop and try to identify one... while ( $ oService = $ oRatingServiceList -> Next ( ) ) { /* @var $oService TdbPkgShopRatingService */ $ pos = strpos ( $ sAffiliateCode , strtolower ( trim ( $ oService -> fieldAffiliateValue ) ) ) ; if ( false !== $ pos ) { //service found! $ oRatingServiceList -> GoToEnd ( ) ; $ sRet = $ oService -> fieldAffiliateValue ; } } } return $ sRet ; }
Try to cleanup incomming shop_order.affiliate_code.

@param $sAffiliateCode

@return string
Try to cleanup incomming shop_order . affiliate_code .