示例#1
0
 public static function onSuccessAddComment(CommentEvent $event)
 {
     $user = $event->getUser();
     Yii::log(sprintf('Success add comment by user_id =  "%s" ', $user->getId()), CLogger::LEVEL_INFO);
     $comment = $event->getComment();
     $module = $event->getModule();
     // сбросить кэш
     Yii::app()->getCache()->delete("Comment{$comment->model}{$comment->model_id}");
     // метка для проверки спама
     Yii::app()->getCache()->set('Comment::Comment::spam::' . $user->getId(), time(), (int) $module->antiSpamInterval);
 }