Пример #1
0
 /**
  * Делает комментарий новым
  */
 public function actionAjaxUpdateSetOld()
 {
     if (!isset($_POST['checkboxes'])) {
         return;
     }
     $userID = \Yii::$app->getModule('comments')->getUserID();
     foreach ($_POST['checkboxes'] as $comment_id) {
         NewComments::find()->where(['user_id' => $userID, 'comment_id' => $comment_id])->delete();
     }
 }
Пример #2
0
 public function isNew($id = false)
 {
     if (false === $id) {
         return false;
     }
     $userID = \Yii::$app->getModule('comments')->getUserID();
     if (!$userID) {
         return false;
     }
     return NewComments::find()->user($userID)->where(['comment_id' => $this->id])->one() ? true : false;
 }