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


PHP Movie::find方法代码示例

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


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

示例1: get_update

 public function get_update($id_pelicula)
 {
     $pelicula = Movie::find($id_pelicula);
     $pelicula->nombre = "Teminator genesis";
     $pelicula->duracion = "3 horas";
     $pelicula->save();
     return Redirect::to('movie');
 }
开发者ID:mdela,项目名称:movie-series,代码行数:8,代码来源:MovieController.php

示例2: review

 public function review($review)
 {
     if (Auth::user()->usr_level == 2) {
         // gets the user details fro username
         $review = DB::table('film_review')->where('fr_id', '=', $review)->first();
         $film = Movie::find($review->fr_fl_id);
         $user = User::find($review->fr_usr_id);
         return view('admin.review', compact('review', 'film', 'user'));
     } else {
         return Redirect::to(Config::get('url.home'));
     }
 }
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:12,代码来源:AdminController.php

示例3: omdbUpdate

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function omdbUpdate($id)
 {
     if (Request::format() == 'json') {
     }
     $rev = Movie::find($id);
     $rev->fl_dir_ar_id = Input::get('info.Director');
     $rev->fl_writer = Input::get('info.Writer');
     $rev->fl_stars = Input::get('info.Actors');
     $rev->fl_outline = Input::get('info.Plot');
     $rev->fl_genre = Input::get('info.Genre');
     $rev->fl_duration = Input::get('info.Runtime');
     $rev->fl_country = Input::get('info.Country');
     $rev->fl_imdbID = Input::get('info.imdbID');
     $rev->fl_imdbRating = Input::get('info.imdbRating');
     $rev->fl_imdbVotes = Input::get('info.imdbVotes');
     $rev->fl_metascore = Input::get('info.Metascore');
     $rev->save();
 }
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:23,代码来源:AdminController+copy.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Response::json(Movie::find($id));
 }
开发者ID:metalikium,项目名称:watch-it-later,代码行数:10,代码来源:MovieController.php

示例5: getDetails

 /**
  *  This function responses to
  *  the get request of /admin/movie/details/{id}
  *  and view movie respect to id
  */
 public function getDetails($id, $msg = null)
 {
     $movie = Movie::find($id);
     if (!empty($msg) && $msg == 1) {
         return View::make('adminArea.movie.details')->with('movie', $movie)->with('orders', Order::orderBy('from', 'desc')->get())->with('success', "Order has been deactivated successfully");
     }
     return View::make('adminArea.movie.details')->with('movie', $movie)->with('orders', Order::orderBy('from', 'desc')->get());
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:13,代码来源:MovieController.php

示例6: function

class Movie extends \Illuminate\Database\Eloquent\Model
{
    public $timestamps = false;
}
/* Obtención de la lista de películas */
$app->get('/movies', function () use($app) {
    // Creamos un objeto collection + json con la lista de películas
    // Obtenemos el objeto request, que representa la petición HTTP
    $req = $app->request;
    // Obtenemos la ruta absoluta de este recurso
    $absUrl = $req->getScheme() . "://" . $req->getHost() . $req->getRootUri() . $req->getResourceUri();
    // Obtenemos la lista de películas de la base de datos y la convertimos del formato Json (el devuelto por Eloquent) a un array PHP
    $pelis = json_decode(\Movie::all());
    $app->view()->setData(array('url' => $absUrl, 'items' => $pelis));
    // Mostramos la vista
    $app->render('movielist_template.php');
});
/*  Obtención de una película en concreto  */
$app->get('/movies/:name', function ($name) use($app) {
    // Creamos un objeto collection + json con la película pasada como parámetro
    // Obtenemos el objeto request, que representa la petición HTTP
    $req = $app->request;
    // Obtenemos la ruta absoluta de este recurso
    $absUrl = $req->getScheme() . "://" . $req->getHost() . $req->getRootUri() . $req->getResourceUri();
    // Obtenemos la película de la base de datos a partir de su id y la convertimos del formato Json (el devuelto por Eloquent) a un array PHP
    $p = \Movie::find($name);
    $peli = json_decode($p);
    $app->view()->setData(array('url' => preg_replace('/' . preg_quote('/' . $name, '/') . '$/', '', $absUrl), 'item' => $peli));
    // Mostramos la vista
    $app->render('movie_template.php');
});
开发者ID:interfacesweb,项目名称:angular-collection,代码行数:31,代码来源:movies.php

示例7: count

    //$name_mov, $email, $description
    $longitud = count($datos);
    for ($i = 0; $i < $longitud; $i++) {
        switch ($datos[$i]['name']) {
            case "name":
                $name_mov = $datos[$i]['value'];
                break;
            case "description":
                $description = $datos[$i]['value'];
                break;
            case "director":
                $director = $datos[$i]['value'];
                break;
            case "datePublished":
                $fecha = $datos[$i]['value'];
                break;
            case "embedUrl":
                $trailer = $datos[$i]['value'];
                break;
        }
    }
    //me inserta una nueva fila a la tabla Movie por asi decirlo. Esta tabla tiene los campos name, description....
    //la variable $name_mov tiene el nombre de la pelicula que quiero guardar
    $mod_movie = \Movie::find($id);
    $mod_movie->name = $name_mov;
    $mod_movie->description = $description;
    $mod_movie->director = $director;
    $mod_movie->datePublished = $fecha;
    $mod_movie->embedUrl = $trailer;
    $mod_movie->save();
});
开发者ID:interfacesweb15-16,项目名称:s4_venus,代码行数:31,代码来源:movies.php

示例8: function

        $film = DB::table('film')->where('fl_name', 'LIKE', $movie)->where('fl_year', '=', $year)->orderBy('fl_rating', 'desc')->first();
        if ($film) {
            //Check if already added or not
            $check = DB::table('user_suggestions')->where('us_fl_id', $film->fl_id)->get();
            if ($check) {
                //Update Movie Details
                $rev = Movie::find($film->fl_id);
                $rev->fl_language = 'English';
                $rev->fl_country = 'USA';
                $rev->save();
                echo 'Already added ' . $film->fl_name . '' . '<br/>';
                echo '<img width="60px" src="http://localhost/lara/public/uploads/movie/' . $film->fl_year . '/' . $film->fl_image . '"/>' . '<br/>';
            } else {
                $query = DB::table('user_suggestions')->insertGetId(array('us_fl_id' => $film->fl_id));
                //Update Movie Details
                $rev = Movie::find($film->fl_id);
                $rev->fl_language = 'English';
                $rev->fl_country = 'USA';
                $rev->save();
                //Updated
                echo 'Just added in suggestion ' . $film->fl_name . '' . '<br/>';
                echo '<img width="60px" src="http://localhost/lara/public/uploads/movie/' . $film->fl_year . '/' . $film->fl_image . '"/>' . '<br/>';
            }
        } else {
            echo '<b>Not found </b>' . $movie . '' . '<br/>';
        }
    }
});
Route::get('ajax/{query}', function ($query) {
    /*$dback = DB::table('film')
                ->where('fl_name', 'LIKE', '%' . $query . '%')
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:31,代码来源:routes.php

示例9: count

    $datos = $template['template']['data'];
    //longitud del vector
    $longitud = count($datos);
    //bucle que recorre vector
    for ($i = 0; $i < $longitud; $i++) {
        switch ($datos[$i]['name']) {
            case "name":
                $name = $datos[$i]['value'];
                break;
            case "description":
                $description = $datos[$i]['value'];
                break;
            case "director":
                $director = $datos[$i]['value'];
                break;
            case "embedUrl":
                $embedUrl = $datos[$i]['value'];
                break;
            case "datePublished":
                $datePublished = $datos[$i]['value'];
                break;
        }
    }
    $nueva_movie = Movie::find($id);
    $nueva_movie['name'] = $name;
    $nueva_movie['description'] = $description;
    $nueva_movie['director'] = $director;
    $nueva_movie['embedUrl'] = $embedUrl;
    $nueva_movie['datePublished'] = $datePublished;
    $nueva_movie->save();
});
开发者ID:interfacesweb15-16,项目名称:s4_mars,代码行数:31,代码来源:movies.php

示例10: getDetails

 /**
  *  This function responses to
  *  the get request of /member/movie/details/{id}
  *  and view movie respect to id
  */
 public function getDetails($id)
 {
     $movie = Movie::find($id);
     return View::make('adminArea.movie.memberMovieDetails')->with('movie', $movie);
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:10,代码来源:MemberHomeController.php

示例11: suggestionAdd

 public function suggestionAdd()
 {
     $film = Input::get('film');
     $check = DB::table('user_suggestions')->where('us_fl_id', $film)->get();
     if ($check) {
         //Do nothing
     } else {
         $query = DB::table('user_suggestions')->insertGetId(array('us_fl_id' => $film));
         $rev = Movie::find($film);
         $rev->fl_language = 'English';
         $rev->fl_country = 'USA';
         $rev->save();
     }
     if ($query) {
         return 'true';
     } else {
         return 'false';
     }
 }
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:19,代码来源:MoviesController.php

示例12: curl_init

<?php

include __DIR__ . '/init.inc.php';
$top_url = 'http://itunes.apple.com/tw/genre/dian-ying/id33?l=zh';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $top_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, 0);
$message = curl_exec($curl);
curl_close($curl);
if (!preg_match_all('#<a href="([^"]*)" class="top-level-genre" title="[^"]*">[^<]*</a>#', $message, $matches)) {
    die('failed');
}
foreach ($matches[1] as $genre_url) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $genre_url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    $message = curl_exec($curl);
    curl_close($curl);
    preg_match_all('#<li><a href="(http://itunes.apple.com/tw/movie/[^/]*/id([0-9]+)\\?l=zh)">([^<]*)</a> </li>#', $message, $matches);
    foreach ($matches[0] as $id => $data) {
        $url = $matches[1][$id];
        $movie_id = $matches[2][$id];
        $movie_name = $matches[3][$id];
        if (Movie::find($movie_id)) {
            continue;
        }
        Movie::insert(array('id' => $movie_id, 'url' => $url, 'description' => $movie_name, 'created_at' => time()));
    }
}
开发者ID:ronnywang,项目名称:itunes-taiwan-update,代码行数:31,代码来源:crawler.php


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