source/Application/Model/Review.php
public function loadList($sType, $aIds, $blLoadEmpty = false, $iLoadInLang = null)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $oRevs = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
        $oRevs->init('oxreview');

        if (is_array($aIds) && count($aIds)) {
            $sObjectIdWhere = "oxreviews.oxobjectid in ( " . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aIds)) . " )";
        } elseif (is_string($aIds) && $aIds) {
            $sObjectIdWhere = "oxreviews.oxobjectid = " . $oDb->quote($aIds);
        } else {
            return $oRevs;
        }

        $iLoadInLang = is_null($iLoadInLang) ? (int) \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage() : (int) $iLoadInLang;

        $sSelect = "select oxreviews.* from oxreviews where oxreviews.oxtype = " . $oDb->quote($sType) . " and $sObjectIdWhere and oxreviews.oxlang = '$iLoadInLang'";

        if (!$blLoadEmpty) {
            $sSelect .= ' and oxreviews.oxtext != "" ';
        }

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blGBModerate')) {
            $sSelect .= ' and ( oxreviews.oxactive = "1" ';
            $sSelect .= ($oUser = $this->getUser()) ? 'or  oxreviews.oxuserid = ' . $oDb->quote($oUser->getId()) . ' )' : ')';
        }

        $sSelect .= ' order by oxreviews.oxcreate desc ';

        $oRevs->selectString($sSelect);

        // change date
        foreach ($oRevs as $oItem) {
            $oItem->oxreviews__oxcreate->convertToFormattedDbDate();
            $oItem->oxreviews__oxtext->convertToPseudoHtml();
        }

        return $oRevs;
    }
public function loadList($sType, $aIds, $blLoadEmpty = false, $iLoadInLang = null)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $oRevs = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
        $oRevs->init('oxreview');

        if (is_array($aIds) && count($aIds)) {
            $sObjectIdWhere = "oxreviews.oxobjectid in ( " . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aIds)) . " )";
        } elseif (is_string($aIds) && $aIds) {
            $sObjectIdWhere = "oxreviews.oxobjectid = " . $oDb->quote($aIds);
        } else {
            return $oRevs;
        }

        $iLoadInLang = is_null($iLoadInLang) ? (int) \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage() : (int) $iLoadInLang;

        $sSelect = "select oxreviews.* from oxreviews where oxreviews.oxtype = " . $oDb->quote($sType) . " and $sObjectIdWhere and oxreviews.oxlang = '$iLoadInLang'";

        if (!$blLoadEmpty) {
            $sSelect .= ' and oxreviews.oxtext != "" ';
        }

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blGBModerate')) {
            $sSelect .= ' and ( oxreviews.oxactive = "1" ';
            $sSelect .= ($oUser = $this->getUser()) ? 'or  oxreviews.oxuserid = ' . $oDb->quote($oUser->getId()) . ' )' : ')';
        }

        $sSelect .= ' order by oxreviews.oxcreate desc ';

        $oRevs->selectString($sSelect);

        // change date
        foreach ($oRevs as $oItem) {
            $oItem->oxreviews__oxcreate->convertToFormattedDbDate();
            $oItem->oxreviews__oxtext->convertToPseudoHtml();
        }

        return $oRevs;
    }
public function loadList ( $ sType , $ aIds , $ blLoadEmpty = false , $ iLoadInLang = null ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ oRevs = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oRevs -> init ( 'oxreview' ) ; if ( is_array ( $ aIds ) && count ( $ aIds ) ) { $ sObjectIdWhere = "oxreviews.oxobjectid in ( " . implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aIds ) ) . " )" ; } elseif ( is_string ( $ aIds ) && $ aIds ) { $ sObjectIdWhere = "oxreviews.oxobjectid = " . $ oDb -> quote ( $ aIds ) ; } else { return $ oRevs ; } $ iLoadInLang = is_null ( $ iLoadInLang ) ? ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) : ( int ) $ iLoadInLang ; $ sSelect = "select oxreviews.* from oxreviews where oxreviews.oxtype = " . $ oDb -> quote ( $ sType ) . " and $sObjectIdWhere and oxreviews.oxlang = '$iLoadInLang'" ; if ( ! $ blLoadEmpty ) { $ sSelect .= ' and oxreviews.oxtext != "" ' ; } if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blGBModerate' ) ) { $ sSelect .= ' and ( oxreviews.oxactive = "1" ' ; $ sSelect .= ( $ oUser = $ this -> getUser ( ) ) ? 'or  oxreviews.oxuserid = ' . $ oDb -> quote ( $ oUser -> getId ( ) ) . ' )' : ')' ; } $ sSelect .= ' order by oxreviews.oxcreate desc ' ; $ oRevs -> selectString ( $ sSelect ) ; // change date foreach ( $ oRevs as $ oItem ) { $ oItem -> oxreviews__oxcreate -> convertToFormattedDbDate ( ) ; $ oItem -> oxreviews__oxtext -> convertToPseudoHtml ( ) ; } return $ oRevs ; }
get oxList of reviews for given object ids and type

@param string  $sType       type of given ids
@param mixed   $aIds        given object ids to load, can be array or just one id, given as string
@param boolean $blLoadEmpty true if want to load empty text reviews
@param int     $iLoadInLang language to select for loading

@return oxList
get oxList of reviews for given object ids and type