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(); }
public function erase() { ChannelAction::table()->delete(array("complementary_id" => $this->id, "type" => "message")); $this->delete(); }
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())); } }
public function destroy($id, $request) { $channel = UserChannel::find($id); if ($channel->owner_id == Session::get()->id && $channel->id != Session::get()->getMainChannel()->id) { Video::table()->delete(array('poster_id' => $channel->id)); ChannelAction::table()->delete(array("channel_id" => $id)); ChannelAction::table()->delete(array("target" => $id)); $channel->delete(); Subscription::cleanDeleted(); return new Response(200); } else { return new Response(500); } }