31 $this->
init(
'oxratings');
48 if ($iRatingLogsTimeout =
$myConfig->getConfigParam(
'iRatingLogsTimeout')) {
49 $sExpDate = date(
'Y-m-d H:i:s',
oxRegistry::get(
"oxUtilsDate")->getTime() - $iRatingLogsTimeout * 24 * 60 * 60);
50 $oDb->execute(
"delete from oxratings where oxtimestamp < '$sExpDate'");
52 $sSelect =
"select oxid from oxratings where oxuserid = " . $oDb->quote($sUserId) .
" and oxtype=" . $oDb->quote($sType) .
" and oxobjectid = " . $oDb->quote($sObjectId);
53 if ($oDb->getOne($sSelect)) {
75 if (is_array($aIncludedObjectsIds) && count($aIncludedObjectsIds) > 0) {
76 $sQuerySnipet =
" AND ( `oxobjectid` = " . $oDb->quote($sObjectId) .
" OR `oxobjectid` in ('" . implode(
"', '", $aIncludedObjectsIds) .
"') )";
78 $sQuerySnipet =
" AND `oxobjectid` = " . $oDb->quote($sObjectId);
86 AND `oxtype` = " . $oDb->quote($sType)
91 if ($fRating = $oDb->getOne($sSelect,
false,
false)) {
92 $fRating = round($fRating, 1);
112 if (is_array($aIncludedObjectsIds) && count($aIncludedObjectsIds) > 0) {
113 $sQuerySnipet =
" AND ( `oxobjectid` = " . $oDb->quote($sObjectId) .
" OR `oxobjectid` in ('" . implode(
"', '", $aIncludedObjectsIds) .
"') )";
115 $sQuerySnipet =
" AND `oxobjectid` = " . $oDb->quote($sObjectId);
123 AND `oxtype` = " . $oDb->quote($sType)
128 $iCount = $oDb->getOne($sSelect,
false,
false);
140 return $this->oxratings__oxtype->value;
150 return $this->oxratings__oxobjectid->value;