예제 #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);
     }
 }