30 $this->
init(
'oxreviews' );
44 if ( isset( $this->oxreviews__oxuserid ) && $this->oxreviews__oxuserid->value ) {
46 $this->oxuser__oxfname =
new oxField( $oDb->getOne(
"select oxfname from oxuser where oxid=".$oDb->quote( $this->oxreviews__oxuserid->value ) ));
59 public function load( $oxId )
61 if ( $blRet = parent::load( $oxId ) ) {
63 $this->oxreviews__oxcreate->setValue(
oxRegistry::get(
"oxUtilsDate")->formatDBDate( $this->oxreviews__oxcreate->value ));
77 $this->oxreviews__oxcreate =
new oxField(date(
'Y-m-d H:i:s',
oxRegistry::get(
"oxUtilsDate")->getTime() ));
92 public function loadList($sType, $aIds, $blLoadEmpty =
false, $iLoadInLang = null)
96 $oRevs =
oxNew(
'oxlist' );
97 $oRevs->init(
'oxreview' );
100 if ( is_array( $aIds ) && count( $aIds ) ) {
101 $sObjectIdWhere =
"oxreviews.oxobjectid in ( ".implode(
", ",
oxDb::getInstance()->quoteArray( $aIds )).
" )";
102 } elseif ( is_string( $aIds ) && $aIds ) {
103 $sObjectIdWhere =
"oxreviews.oxobjectid = ".$oDb->quote( $aIds );
108 $iLoadInLang = is_null( $iLoadInLang ) ? (int)
oxRegistry::getLang()->getBaseLanguage() : (int) $iLoadInLang;
110 $sSelect =
"select oxreviews.* from oxreviews where oxreviews.oxtype = ".$oDb->quote( $sType ).
" and $sObjectIdWhere and oxreviews.oxlang = '$iLoadInLang'";
112 if ( !$blLoadEmpty ) {
113 $sSelect .=
' and oxreviews.oxtext != "" ';
116 if ( $this->
getConfig()->getConfigParam(
'blGBModerate' ) ) {
117 $sSelect .=
' and ( oxreviews.oxactive = "1" ';
118 $sSelect .= ( $oUser = $this->
getUser() ) ?
'or oxreviews.oxuserid = ' . $oDb->quote( $oUser->getId() ) .
' )' :
')';
121 $sSelect .=
' order by oxreviews.oxcreate desc ';
123 $oRevs->selectString( $sSelect );
126 foreach ( $oRevs as $oItem ) {
127 $oItem->oxreviews__oxcreate->convertToFormattedDbDate();
128 $oItem->oxreviews__oxtext->convertToPseudoHtml();
141 return $this->oxreviews__oxtype->value;
151 return $this->oxreviews__oxobjectid->value;