Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/rating_helper.php
Show First 20 Lines • Show All 247 Lines • ▼ Show 20 Line(s) | |||||
* Returns SpamHelper object linked to given object | * Returns SpamHelper object linked to given object | ||||
* | * | ||||
* @param kDBItem $object | * @param kDBItem $object | ||||
* @return SpamHelper | * @return SpamHelper | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function &_getSpamHelper(&$object) | protected function &_getSpamHelper(&$object) | ||||
{ | { | ||||
/** @var SpamHelper $spam_helper */ | |||||
$spam_helper = $this->Application->recallObject('SpamHelper'); | $spam_helper = $this->Application->recallObject('SpamHelper'); | ||||
/* @var $spam_helper SpamHelper */ | |||||
// 2. user isn't voting too frequently | // 2. user isn't voting too frequently | ||||
$config_mapping = $this->Application->getUnitOption($object->Prefix, 'ConfigMapping'); | $config_mapping = $this->Application->getUnitOption($object->Prefix, 'ConfigMapping'); | ||||
$review_settings = $config_mapping['RatingDelayValue'] . ':' . $config_mapping['RatingDelayInterval']; | $review_settings = $config_mapping['RatingDelayValue'] . ':' . $config_mapping['RatingDelayInterval']; | ||||
$spam_helper->InitHelper($object->GetDBField('ResourceId'), 'Rating', $review_settings, $object->GetCol('ResourceId')); | $spam_helper->InitHelper($object->GetDBField('ResourceId'), 'Rating', $review_settings, $object->GetCol('ResourceId')); | ||||
return $spam_helper; | return $spam_helper; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |