/** * Отписка от рассылки комментариев * @param $hash * @param string $url */ public function actionUnsubscribe($hash, $url = '') { $subscriber = Comment::findByHashUrl($hash, $url); $comments = empty($url) ? Comment::model()->findAllByAttributes(array('email' => $subscriber->email)) : Comment::model()->page($url)->findAllByAttributes(array('email' => $subscriber->email)); foreach ($comments as $comment) { $comment->notify = Comment::NOT_NOTIFY; $comment->save(); } $this->renderPartial('unsubscribe'); }