本文整理匯總了PHP中Book::setDesc方法的典型用法代碼示例。如果您正苦於以下問題:PHP Book::setDesc方法的具體用法?PHP Book::setDesc怎麽用?PHP Book::setDesc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Book
的用法示例。
在下文中一共展示了Book::setDesc方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handlePUT
function handlePUT(mysqli $conn)
{
parse_str(file_get_contents("php://input"), $data);
$book = new Book();
$book->update($conn, $data['id']);
$book->setTitle($data['title']);
$book->setAuthor($data['author']);
$book->setDesc($data['desc']);
}
示例2: handlePUT
function handlePUT()
{
$conn = Connection::startConnection();
parse_str(file_get_contents("php://input"), $data);
header('Content-type: application/json');
$book = new Book();
$book->setName($data['name']);
$book->setAuthor($data['author']);
$book->setDesc($data['opis']);
$book->updateBook($conn, $data['id']);
Connection::stopConnecion($conn);
}
示例3: Game
include 'database_connection.php';
include 'classes/MediaItem.php';
include 'classes/Game.php';
include 'classes/Book.php';
include 'classes/Music.php';
include 'classes/Movie.php';
$game = new Game();
$game->setTitle('Watch Dogs');
$game->setDesc('Crappy shit wannabe hacker game');
$game->setRating(1);
$game->setTags(['dnt']);
print '<p>' . ($game->save() ? "Saving successful" : "Saving unsuccessful") . '</p>';
$book = new Book();
$book->setTitle('Momo');
$book->setDesc('Dreamy and so on');
$book->setRating(4);
$book->setTags(['tc']);
print '<p>' . ($book->save() ? "Saving successful" : "Saving unsuccessful") . '</p>';
$movie = new Movie();
$movie->setTitle('The big short');
$movie->setDesc('Capitalism');
$movie->setRating(3);
$movie->setTags(['tc', 'wtf']);
print '<p>' . ($movie->save() ? "Saving successful" : "Saving unsuccessful") . '</p>';
$music = new Music();
$music->setTitle('Bravo Hits 666');
$music->setDesc('Diabolic Bullshit');
$music->setRating(1);
$music->setTags(['dnt']);
print '<p>' . ($music->save() ? "Saving successful" : "Saving unsuccessful") . '</p>';