public function readnotifyAction() { $this->view->disable(); $usersId = $this->auth->getAuth()['id']; if ($this->request->isPost()) { $id = $this->request->getPost('id'); $object = $this->request->getPost('object'); if ($object == ActivityNotifications::TYPE_POSTS) { $notify = ActivityNotifications::findFirst(['usersId = ?0 AND postsId = ?1', 'bind' => [$usersId, $id]]); } else { $notify = ActivityNotifications::findFirst(['usersId = ?0 AND postsReplyId = ?1', 'bind' => [$usersId, $id]]); } if ($notify) { $notify->setWasRead('Y'); if (!$notify->save()) { $this->saveLoger($notify->getMessages()); } } } }