/** * @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; }