當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Video::all方法代碼示例

本文整理匯總了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'));
 }
開發者ID:spikomino,項目名稱:site,代碼行數:21,代碼來源:controllerVideo.php

示例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));
 }
開發者ID:agiza,項目名稱:DreamVids,代碼行數:19,代碼來源:video.php

示例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'));
 }
開發者ID:boulama,項目名稱:DreamVids,代碼行數:5,代碼來源:user_channel.php

示例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">
開發者ID:helloworldprojects,項目名稱:Autism,代碼行數:31,代碼來源:videos.php

示例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);
 }
開發者ID:glennpeterm,項目名稱:MyStoryWeb,代碼行數:34,代碼來源:VideosController.php


注:本文中的Video::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。