本文整理汇总了PHP中Video::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::all方法的具体用法?PHP Video::all怎么用?PHP Video::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newVideo
public function newVideo()
{
// Permet de trouver une nouvelle vidéo à l'utilisateur
$videos = Video::all();
foreach ($videos as $video) {
try {
$questionnaire = Video::find($video->id_video)->questionnaire()->where('id_user', '=', $_SESSION['id_user'])->firstorFail();
// Si la vidéo à un questionnaire pour l'utilisateur, on passe à une autre vidéo
} catch (\Exception $e) {
// Si elle n'a pas de vidéo, alors ce sera la prochaine vidéo à annoter
$_SESSION['id_video'] = $video->id_video;
$this->app->controllerUser->video();
$_SESSION['page'] = 4;
// On dirige la personne vers la page de remerciement pour l'inviter à annoter une nouvelle vidéo
$this->app->redirect($this->app->urlFor('remerciement'));
}
}
$_SESSION['page'] = 5;
// Si toutes les vidéo on été annoté, alors l'utilisateur est dirigé vers une page de fin d'expérience
$this->app->redirect($this->app->urlFor('fin'));
}
示例2: getSearchVideosByTags
public static function getSearchVideosByTags($tags_array, $order, $contain_all = false)
{
if ($order == "none") {
$order = "timestamp desc";
}
$sql_string = "";
$args = array();
$cond = array();
foreach ($tags_array as $k => $value) {
$tags_array[$k] = str_replace("#", "", $value);
$sql_string .= " tags LIKE ? " . ($contain_all ? "AND" : "OR");
$args[] = "%" . $tags_array[$k] . "%";
}
$sql_string .= $contain_all ? " 1" : " 0";
$cond[] = $sql_string . ' AND visibility = ?';
$cond = array_merge($cond, $args);
$cond[] = Config::getValue_('vid_visibility_public');
return Video::all(array('conditions' => $cond, 'order' => $order));
}
示例3: getPostedVideos
public function getPostedVideos($publicOnly = true)
{
$visibility = $publicOnly ? 'AND visibility = ' . Config::getValue_('vid_visibility_public') : '';
return Video::all(array('conditions' => array("poster_id = ? AND visibility != ? " . $visibility, $this->id, Config::getValue_('vid_visibility_suspended')), 'order' => 'timestamp desc'));
}
示例4: Session
require '../config.php';
require_once '../helpers/session.php';
require '../helpers/boot.php';
require '../helpers/functions.php';
require_once '../helpers/User.php';
require_once '../helpers/Article.php';
require_once '../helpers/Video.php';
require_once '../helpers/Level.php';
$session = new Session();
$user = NULL;
if ($session->getLoggedin()) {
$user = User::find($session->getUsername());
$level = Level::where('user_id', $user->id)->first();
$video = Video::where('level', $level->level)->get();
} else {
$video = Video::all();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Autism</title>
<link href="../static/css/awe.css" rel="stylesheet">
<link href="../static/css/player.css" rel="stylesheet">
<script type="text/javascript" src="../static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../static/js/bootstrap.min.js"></script>
<link href="../static/css/bootstrap.min.css" rel="stylesheet">
示例5: allVideos
/**
* Return all videos
* POST /allvideos
* @param string $language
* @return Response
*/
public function allVideos()
{
$arr = array();
$language = trim(Input::get('language'));
if ($language == '') {
$arr['Success'] = false;
$arr['Status'] = 'Parameter missing: language';
$arr['StatusCode'] = 400;
} else {
// $videos = Video::where('video_language', $language)
// ->get(array('video_id as id'));
$videos = Video::all();
if (count($videos) == 0) {
$arr['Success'] = false;
$arr['Status'] = 'Video not found';
$arr['StatusCode'] = 404;
} else {
$arr['Success'] = true;
$arr['Status'] = 'OK';
$arr['StatusCode'] = 200;
$arr['language'] = $language;
$url = Config::get('app.channel_videos_web_view_url');
$url = str_replace('{language}', $language, $url);
$arr['url'] = $url;
}
}
return Response::json($arr);
}