Example #1
0
 /**
  * @param $commentId
  * @param $isGuest
  * @param $userHash
  * @param $userId
  * @return bool
  */
 private function _checkMark($commentId, $isGuest, $userHash, $userId)
 {
     $where = ['comment_id' => $commentId];
     if ($isGuest) {
         $where['user_hash'] = $userHash;
     } else {
         $where['user_id'] = $userId;
     }
     if (Mark::find()->where($where)->count()) {
         return true;
     }
     return false;
 }
Example #2
0
 public function getMarks()
 {
     return $this->hasMany(Mark::className(), ['comment_id' => 'id']);
 }