本文整理汇总了PHP中Movie::setMovie方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::setMovie方法的具体用法?PHP Movie::setMovie怎么用?PHP Movie::setMovie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::setMovie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateMovie
private function CreateMovie()
{
$movie = new Movie();
$data = array();
$data['title'] = $_POST['title'];
$url = $this->uploadImage($_FILES['poster']);
if ($url != false) {
$data['poster'] = $url;
}
$data['rating'] = $_POST['rating'];
$data['description'] = $_POST['description'];
$data['genre'] = $_POST['genre'];
$data['type'] = $_POST['type'];
$data['year'] = $_POST['year'];
$data['release_time'] = $_POST['release_time'];
$data['run_time'] = $_POST['run_time'];
$data['keyword'] = $_POST['keyword'];
$img = $this->uploadImage($_FILES['big_picture']);
if ($img != false) {
$data['big_picture'] = $img;
}
if (!empty($_POST['parent'])) {
$sql = mysql_query("SELECT * FROM Movies WHERE title LIKE '%" . $_POST['parent'] . "%'");
$result = mysql_fetch_assoc($sql);
$data['parent_id'] = $result['id'];
} else {
$data['parent_id'] = 0;
}
$movie->setMovie($data);
return $movie;
}
示例2: 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);
}
}