本文整理汇总了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;
}
示例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);
}
}
示例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 */
示例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');
}
}
}
示例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);
}
}