/**
  * returns reviews list for article
  *
  * @param oxArticle $oArticle Article object
  *
  * @return oxList
  */
 protected function _getReviewList($oArticle)
 {
     $oDb = oxDb::getDb();
     $sSelect = "select oxreviews.* from oxreviews\n                     where oxreviews.OXOBJECTID = " . $oDb->quote($oArticle->oxarticles__oxid->value) . "\n                     and oxreviews.oxtype = 'oxarticle'";
     $aVariantList = $oArticle->getVariants();
     if ($this->getConfig()->getConfigParam('blShowVariantReviews') && count($aVariantList)) {
         // verifying rights
         foreach ($aVariantList as $oVariant) {
             $sSelect .= "or oxreviews.oxobjectid = " . $oDb->quote($oVariant->oxarticles__oxid->value) . " ";
         }
     }
     //$sSelect .= "and oxreviews.oxtext".oxLang::getInstance()->getLanguageTag($this->_iEditLang)." != ''";
     $sSelect .= "and oxreviews.oxlang = '" . $this->_iEditLang . "'";
     $sSelect .= "and oxreviews.oxtext != '' ";
     // all reviews
     $oRevs = oxNew("oxlist");
     $oRevs->init("oxreview");
     $oRevs->selectString($sSelect);
     return $oRevs;
 }
Esempio n. 2
0
 /**
  * returns reviews list for article
  *
  * @param oxArticle $article Article object
  *
  * @return oxList
  */
 protected function _getReviewList($article)
 {
     $database = oxDb::getDb();
     $query = "select oxreviews.* from oxreviews\n                     where oxreviews.OXOBJECTID = " . $database->quote($article->oxarticles__oxid->value) . "\n                     and oxreviews.oxtype = 'oxarticle'";
     $variantList = $article->getVariants();
     if ($this->getConfig()->getConfigParam('blShowVariantReviews') && count($variantList)) {
         // verifying rights
         foreach ($variantList as $variant) {
             $query .= "or oxreviews.oxobjectid = " . $database->quote($variant->oxarticles__oxid->value) . " ";
         }
     }
     //$sSelect .= "and oxreviews.oxtext".oxRegistry::getLang()->getLanguageTag($this->_iEditLang)." != ''";
     $query .= "and oxreviews.oxlang = '" . $this->_iEditLang . "'";
     $query .= "and oxreviews.oxtext != '' ";
     // all reviews
     $reviewList = oxNew("oxlist");
     $reviewList->init("oxreview");
     $reviewList->selectString($query);
     return $reviewList;
 }