本文整理汇总了PHP中Movie::setDirector方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::setDirector方法的具体用法?PHP Movie::setDirector怎么用?PHP Movie::setDirector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::setDirector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildDomainObject
protected function buildDomainObject($row)
{
$movie = new Movie();
$movie->setId($row['mov_id']);
$movie->setTitle($row['mov_title']);
$movie->setDecriptionShort($row['mov_description_short']);
$movie->setDecriptionLong($row['mov_description_long']);
$movie->setDirector($row['mov_director']);
$movie->setYear($row['mov_year']);
$movie->setImage($row['mov_image']);
if (array_key_exists('id_categorie', $row)) {
$categoryID = $row['cat_id'];
$category = $this->categoryDAO->find($categoryId);
$movie->setCategory($category);
}
return $movie;
}
示例2: db_add_movie
public function db_add_movie()
{
if (isset($_POST['submit'])) {
try {
$db = new Database();
$movie = new Movie($db);
$movie->setTitle(htmlspecialchars($_POST['movie-title']));
$movie->setDirector(htmlspecialchars($_POST['movie-director']));
$movie->setSynopsis(htmlspecialchars($_POST['movie-synopsis']));
$movie->setYear(htmlspecialchars($_POST['movie-year']));
$movie->setCountry(htmlspecialchars($_POST['movie-country']));
$movie->setDuration(htmlspecialchars($_POST['movie-duration']));
$movie->add_movie();
} catch (Exception $e) {
echo "Error: {$e->getMessage()}";
}
}
}
示例3: Movie
$movie = new Movie($db);
$selected = substr($_POST['update_title'], 1, -1);
$movie->setId($selected);
$rows = $movie->find_movie_by_id();
if (is_array($rows)) {
try {
$view = new View();
$view->view_selected_movie($rows);
} catch (Exception $e) {
echo "Error: {$e->getMessage()}";
}
} else {
throw new Exception("Error: Please contact the tech guys.");
}
$db = NULL;
}
if (isset($_POST['update_movie'])) {
$db = new Database();
$movie = new Movie($db);
$selected = $_POST['movie_id'];
$movie->setId($selected);
$movie->setTitle($_POST['movie-title']);
$movie->setDirector($_POST['movie-director']);
$movie->setSynopsis($_POST['movie-synopsis']);
$movie->setYear($_POST['movie-year']);
$movie->setCountry($_POST['movie-country']);
$movie->setDuration($_POST['movie-duration']);
if ($movie->update_movie()) {
echo "It works!";
}
}