示例#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();
 }
示例#2
0
 public function erase()
 {
     ChannelAction::table()->delete(array("complementary_id" => $this->id, "type" => "message"));
     $this->delete();
 }
示例#3
0
文件: video.php 项目: agiza/DreamVids
 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()));
     }
 }
示例#4
0
 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);
     }
 }