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