当前位置: 首页>>代码示例>>PHP>>正文


PHP Video::delete方法代码示例

本文整理汇总了PHP中Video::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::delete方法的具体用法?PHP Video::delete怎么用?PHP Video::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Video的用法示例。


在下文中一共展示了Video::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remove

 public static function remove(Video $video)
 {
     if (!Session::get('is_admin')) {
         if ($video->user_id !== Auth::user()->id_member) {
             return false;
         }
     }
     $video->delete();
     return true;
 }
开发者ID:hristodinev,项目名称:site,代码行数:10,代码来源:Video.php

示例2: unlinkFromVideo

 /**
  * Unlink files from video
  */
 public function unlinkFromVideo()
 {
     $post = $this->input->post();
     if (!empty($post['video_id'])) {
         $video = new Video($post['video_id']);
         if (!empty($post['video_file_id'])) {
             $video->video_file_id = null;
             $video->save();
             $result['video_file_id'] = $post['video_file_id'];
         }
         if (!empty($post['file'])) {
             $file = new File($post['file'][0]);
             if ($file->exists()) {
                 $video->delete($file);
                 $result['file'] = $post['file'];
             }
         }
         $result['success'] = true;
         echo json_encode($result);
     }
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:24,代码来源:upload.php

示例3: setup_module

        exit;
    }

    if ($_GET['type'] == 'audio') {
        $new_image = new Audio();
        $new_image->content_id = $id;
        $new_image->delete($id);
        $msg = 2005;
        header("Location: $base_url/media_gallery.php?type=$type&msg_id=$msg&album_id=$album_id");
        exit;
    }

    if ($_GET['type'] == 'video') {
        $new_image = new Video();
        $new_image->content_id = $id;
        $new_image->delete($id);
        $msg = 2006;
        header("Location: $base_url/media_gallery.php?type=$type&msg_id=$msg&album_id=$album_id");
        exit;
    }
  }
}
catch (PAException $e) {
   $msg = "$e->message";
   $error = TRUE;
}
/* End of Uploading and deleting */
     
/* This function is a Callback function which initialize the value for the BLOCK MODULES */
function setup_module($column, $moduleName, $obj) {
/* in this module we have to set user_id , group_id, as well as netwrok_id */  
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:31,代码来源:media_gallery.php

示例4: foreach

    Redirect::to('../index.php');
} else {
    if (!$user->isLoggedIn() || !$user->hasPermission('admin')) {
        Redirect::to('../index.php');
    } else {
        foreach ($_GET as $key => $value) {
            if ($value == "") {
                Redirect::to('../index.php');
            }
        }
        if (Input::exists('get')) {
            $video_entry = new Video();
            $video_entry_id = $video_entry->safe_string(Input::get('id'));
            $video_entry->find($video_entry_id);
            if (!$video_entry->exists()) {
                Redirect::to('../index.php');
            } else {
                $video_entry_title = $video_entry->data()->video_title;
                try {
                    $video_entry->delete(['id', '=', Input::get('id')]);
                    Session::flash('delete', 'Video for entry "' . $video_entry_title . '" has been deleted from the database.');
                    Redirect::to('../index.php');
                } catch (Exception $e) {
                    die($e->getMessage());
                }
            }
        } else {
            Redirect::to('../index.php');
        }
    }
}
开发者ID:reggiegulle,项目名称:StoryOfMH370,代码行数:31,代码来源:delete_video.php

示例5: unlink

                 if ($videoObj->{$postVar} === "") {
                     array_push($errorArr, "Please enter {$postVar} ");
                 }
                 break;
             default:
                 $videoObj->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
                 if ($videoObj->{$postVar} === "") {
                     array_push($errorArr, "Please enter {$postVar} ");
                 }
                 break;
         }
     }
     if (count($errorArr) < 1) {
         if ($videoMedFil != '' && file_exists(MEDIA_FILES_PATH . "video/" . $videoMedFil)) {
             unlink(MEDIA_FILES_PATH . "video/" . $videoMedFil);
             echo $videoObj->delete();
         } else {
             $json = array("status" => 0, "msg" => $errorArr);
             $dbObj->close();
             //Close Database Connection
             header('Content-type: application/json');
             echo json_encode($json);
         }
     } else {
         $json = array("status" => 0, "msg" => $errorArr);
         $dbObj->close();
         //Close Database Connection
         header('Content-type: application/json');
         echo json_encode($json);
     }
 }
开发者ID:Mojolagbe2014,项目名称:mojoimipakiti,代码行数:31,代码来源:manage-videos.php


注:本文中的Video::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。