|
@@ 146-155 (lines=10) @@
|
| 143 |
|
* Get uprated comments |
| 144 |
|
* @return null|string |
| 145 |
|
*/ |
| 146 |
|
public static function getUprated() |
| 147 |
|
{ |
| 148 |
|
$cookies = Yii::$app->request->cookies; |
| 149 |
|
if ($cookies->has(CommentsModule::getInstance()->upRatedCookieName)) { |
| 150 |
|
return !empty($cookies[CommentsModule::getInstance()->upRatedCookieName]->value) ? |
| 151 |
|
$cookies[CommentsModule::getInstance()->upRatedCookieName]->value : null; |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
return null; |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
/** |
| 158 |
|
* Check if comment is rated by user |
|
@@ 230-239 (lines=10) @@
|
| 227 |
|
* Get downrated comments |
| 228 |
|
* @return null|string |
| 229 |
|
*/ |
| 230 |
|
public static function getDownrated() |
| 231 |
|
{ |
| 232 |
|
$cookies = Yii::$app->request->cookies; |
| 233 |
|
if ($cookies->has(CommentsModule::getInstance()->downRatedCookieName)) { |
| 234 |
|
return !empty($cookies[CommentsModule::getInstance()->downRatedCookieName]->value) ? |
| 235 |
|
$cookies[CommentsModule::getInstance()->downRatedCookieName]->value : null; |
| 236 |
|
} |
| 237 |
|
|
| 238 |
|
return null; |
| 239 |
|
} |
| 240 |
|
|
| 241 |
|
/** |
| 242 |
|
* Check if comment is downrated by user |