Пример #1
0
 public function undislike($user)
 {
     if (is_object($user) && $this->isDislikedByUser($user) && $this->dislikes > 0) {
         ChannelAction::create(array('id' => ChannelAction::generateId(6), 'channel_id' => $user->getMainChannel()->id, 'recipients_ids' => UserChannel::find($this->poster_id)->admins_ids, 'type' => 'undislike_comment', 'target' => $this->id, 'timestamp' => Utils::tps()));
         ChannelAction::find(array('channel_id' => $user->getMainChannel()->id, 'type' => 'dislike_comment', 'target' => $this->id))->delete();
         $this->dislikes--;
         $this->save();
     }
 }