/** * Set Notify users that always want notifications via Queueing jobs * * @param integer $userId user want notification * @param integer $postId [description] * @param integer $postReplyId [description] * @param string $type Such as Comment, reply... * * @return integet|bool */ public function setNotification($userId, $postId, $postReplyId, $type) { $notification = new Notifications(); $notification->setUsersId($userId); $notification->setPostsId($postId); $notification->setPostsReplyId($postReplyId); $notification->setType($type); if (!$notification->save()) { $messages = $notification->getMessages(); error_log('setNotification error' . __LINE__ . $messages[0]); return false; } return $notification->getId(); }