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


PHP Movie::update方法代码示例

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


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

示例1: parseMovie

 public function parseMovie($movie_array)
 {
     $movie = new Movie();
     $movie->setMovie($movie_array);
     if ($movie->exists()) {
         if ($movie->requiresUpdate()) {
             $movie->update();
         } else {
             echo "OK - ID: " . $movie->id . "; Modified: " . $movie->modified . "<br>";
         }
     } else {
         $movie->insert();
     }
     if ($movie_array->venues->children()) {
         Movie::parseMovieVenues($movie_array['movieId'], $movie_array->venues);
     }
 }
开发者ID:ievgen11,项目名称:going_test_1,代码行数:17,代码来源:index.php

示例2: getimagesize

            $coverLoc = WWW_DIR . "covers/movies/" . $id . '-cover.jpg';
            $backdropLoc = WWW_DIR . "covers/movies/" . $id . '-backdrop.jpg';
            if ($_FILES['cover']['size'] > 0) {
                $tmpName = $_FILES['cover']['tmp_name'];
                $file_info = getimagesize($tmpName);
                if (!empty($file_info)) {
                    move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
                }
            }
            if ($_FILES['backdrop']['size'] > 0) {
                $tmpName = $_FILES['backdrop']['tmp_name'];
                $file_info = getimagesize($tmpName);
                if (!empty($file_info)) {
                    move_uploaded_file($_FILES['backdrop']['tmp_name'], $backdropLoc);
                }
            }
            $_POST['cover'] = file_exists($coverLoc) ? 1 : 0;
            $_POST['backdrop'] = file_exists($backdropLoc) ? 1 : 0;
            $movie->update($id, $_POST["title"], $_POST['tagline'], $_POST["plot"], $_POST["year"], $_POST["rating"], $_POST["genre"], $_POST["director"], $_POST["actors"], $_POST["language"], $_POST["cover"], $_POST['backdrop']);
            header("Location:" . WWW_TOP . "/movie-list.php");
            die;
            break;
        case 'view':
        default:
            $page->title = "Movie Edit";
            $page->smarty->assign('movie', $mov);
            break;
    }
}
$page->content = $page->smarty->fetch('movie-edit.tpl');
$page->render();
开发者ID:nubzzz,项目名称:newznab,代码行数:31,代码来源:movie-edit.php

示例3: getimagesize

            $coverLoc = WWW_DIR . "covers/movies/" . $id . '-cover.jpg';
            $backdropLoc = WWW_DIR . "covers/movies/" . $id . '-backdrop.jpg';
            if ($_FILES['cover']['size'] > 0) {
                $tmpName = $_FILES['cover']['tmp_name'];
                $file_info = getimagesize($tmpName);
                if (!empty($file_info)) {
                    move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
                }
            }
            if ($_FILES['backdrop']['size'] > 0) {
                $tmpName = $_FILES['backdrop']['tmp_name'];
                $file_info = getimagesize($tmpName);
                if (!empty($file_info)) {
                    move_uploaded_file($_FILES['backdrop']['tmp_name'], $backdropLoc);
                }
            }
            $_POST['cover'] = file_exists($coverLoc) ? 1 : 0;
            $_POST['backdrop'] = file_exists($backdropLoc) ? 1 : 0;
            $movie->update(['actors' => $_POST["actors"], 'backdrop' => $_POST['backdrop'], 'cover' => $_POST["cover"], 'director' => $_POST["director"], 'genre' => $_POST["genre"], 'imdbid' => $id, 'language' => $_POST["language"], 'plot' => $_POST["plot"], 'rating' => $_POST["rating"], 'tagline' => $_POST['tagline'], 'title' => $_POST["title"], 'year' => $_POST["year"]]);
            header("Location:" . WWW_TOP . "/movie-list.php");
            die;
            break;
        case 'view':
        default:
            $page->title = "Movie Edit";
            $page->smarty->assign('movie', $mov);
            break;
    }
}
$page->content = $page->smarty->fetch('movie-edit.tpl');
$page->render();
开发者ID:RickDB,项目名称:newznab-tmux,代码行数:31,代码来源:movie-edit.php


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