Esempio n. 1
0
 public function erase(User $user)
 {
     if ($user->isModerator() || $user->isAdmin()) {
         ModoAction::create(array('id' => ModoAction::generateId(6), 'user_id' => $user->id, 'type' => 'delete_comment', 'target' => $this->id, 'timestamp' => Utils::tps()));
     }
     ChannelAction::table()->delete(array("type" => "comment", "complementary_id" => $this->id));
     $this->delete();
 }
Esempio n. 2
0
 public function erase($userId)
 {
     $this->delete();
     ChannelAction::table()->delete(array("target" => $this->id));
     //TODO: Delete file
     if (Session::get()->isModerator() || Session::get()->isAdmin()) {
         ModoAction::create(array('id' => ModoAction::generateId(6), 'user_id' => $userId, 'type' => 'delete', 'target' => $this->id, 'timestamp' => Utils::tps()));
     }
 }