當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Book::deleteAll方法代碼示例

本文整理匯總了PHP中Book::deleteAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Book::deleteAll方法的具體用法?PHP Book::deleteAll怎麽用?PHP Book::deleteAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Book的用法示例。


在下文中一共展示了Book::deleteAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 protected function tearDown()
 {
     Author::deleteAll();
     Book::deleteAll();
     Patron::deleteAll();
     Copies::deleteAll();
 }
開發者ID:jschold,項目名稱:Library,代碼行數:7,代碼來源:CopiesTest.php

示例2: tearDown

 protected function tearDown()
 {
     Checkout::deleteAll();
     Book::deleteAll();
     Author::deleteAll();
     Patron::deleteAll();
 }
開發者ID:kellimargaret,項目名稱:2015.08.26.Library,代碼行數:7,代碼來源:CheckoutTest.php

示例3: tearDown

 protected function tearDown()
 {
     Copy::deleteAll();
     Book::deleteAll();
     Checkout::deleteAll();
     Patron::deleteAll();
 }
開發者ID:kevintokheim,項目名稱:Library,代碼行數:7,代碼來源:CopyTest.php

示例4: tearDown

 protected function tearDown()
 {
     Book::deleteAll();
     Copy::deleteAll();
     Author::deleteAll();
     Patron::deleteAll();
 }
開發者ID:nathanhwyoung,項目名稱:Library-2,代碼行數:7,代碼來源:CheckoutTest.php

示例5: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $title = "History of whatever";
     $test_book = new Book($title);
     $test_book->save();
     $title2 = "History of nothing";
     $test_book2 = new Book($title2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     $result = Book::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:r-hills,項目名稱:Library,代碼行數:15,代碼來源:BookTest.php

示例6: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $title = "Title";
     $test_book = new Book($title);
     $test_book->save();
     $title2 = "New Title";
     $test_book2 = new Book($title2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     $result = Book::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:bdspen,項目名稱:library,代碼行數:15,代碼來源:BookTest.php

示例7: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $id = null;
     $name = "A Series of Unfortunate Events";
     $test_book = new Book($id, $name);
     $test_book->save();
     $name2 = "Fresh Off the Boat";
     $test_book2 = new Book($id, $name2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     $result = Book::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:kellimargaret,項目名稱:2015.08.26.Library,代碼行數:16,代碼來源:BookTest.php

示例8: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $book_name = "Intro to Art";
     $test_book = new Book($book_name);
     $test_book->save();
     $book_name2 = "Intro to Spanish";
     $book_author2 = "SPN101";
     $test_book2 = new Book($book_name2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     $result = Book::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:kevintokheim,項目名稱:Library,代碼行數:16,代碼來源:BookTest.php

示例9: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $title = "Where the Red Fern Grows";
     $id = null;
     $test_book = new Book($title, $id);
     $test_book->save();
     $title2 = "Where the Wild Things Are";
     $test_book2 = new Book($title2, $id);
     $test_book2->save();
     //Act
     Book::deleteAll();
     //Assert
     $result = Book::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:jcubed22,項目名稱:library-1,代碼行數:16,代碼來源:BookTest.php

示例10: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $title = "Harry Potter";
     $id = 1;
     $test_book = new Book($title, $id);
     $test_book->save();
     $title2 = "Moby Dick";
     $id2 = 2;
     $test_book2 = new Book($title, $id);
     $test_book2->save();
     //Act
     Book::deleteAll();
     $result = Book::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:bborealis,項目名稱:library,代碼行數:17,代碼來源:BookTest.php

示例11: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $title = "Whimsical Fairytales...and other stories";
     $genre = "Fantasy";
     $test_book = new Book($title, $genre);
     $test_book->save();
     $title2 = "The Secret Life of Garden Gnomes";
     $genre2 = "Nonfiction";
     $test_book2 = new Book($title2, $genre2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     //Assert
     $result = Book::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:r-hills,項目名稱:library-1,代碼行數:17,代碼來源:BookTest.php

示例12: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $title = "World War Z";
     $genre = "Horror";
     $test_book = new Book($title, $genre);
     $test_book->save();
     $name2 = "Billy Bartle-Barnaby";
     $enroll_date2 = "2015-07-09";
     $test_book2 = new Book($name2, $enroll_date2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     //Assert
     $result = Book::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:kellimargaret,項目名稱:Library-Search,代碼行數:17,代碼來源:BookTest.php

示例13: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $author_first = "Dr.";
     $author_last = "Seuss";
     $title = "The Cat in the Hat";
     $test_book = new Book($author_first, $author_last, $title);
     $test_book->save();
     $author_first2 = "Stephen";
     $author_last2 = "King";
     $title2 = "Misery";
     $test_book2 = new Book($author_first2, $author_last2, $title2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     //Assert
     $result = Book::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:alexMcosta,項目名稱:library,代碼行數:19,代碼來源:BookTest.php

示例14: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $title = "Speaker for the Dead";
     $date = "1987";
     $id = null;
     $test_book = new Book($title, $date, $id);
     $test_book->save();
     $title2 = "Frankenstein";
     $date2 = "1750";
     $id2 = null;
     $test_book2 = new Book($title2, $date2, $id2);
     $test_book2->save();
     //Act
     Book::deleteAll();
     //Assert
     $result = Book::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:Camolot,項目名稱:library,代碼行數:19,代碼來源:BooksTest.php

示例15: array

$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
use Symfony\Component\HttpFoundation\Request;
Request::enableHttpMethodParameterOverride();
// HOME PAGE - DISPLAYS ADMIN LINK AND PATRON LINK
$app->get('/', function () use($app) {
    return $app['twig']->render('index.html.twig');
});
// ADMIN PAGE - DISPLAYS BOOK CATALOG
$app->get("/main_admin", function () use($app) {
    $books = Book::getAll();
    $authors = Author::getAll();
    return $app['twig']->render("main_admin.html.twig", array('books' => $books, 'authors' => $authors));
});
$app->post("/delete_books", function () use($app) {
    $GLOBALS['DB']->exec("DELETE FROM books;");
    Book::deleteAll();
    return $app['twig']->render('main_admin.html.twig', array('books' => Book::getAll()));
});
//add new book with author
$app->post("/book_added", function () use($app) {
    // create new book from user entry "add book"
    $title = $_POST['title'];
    $new_book = new Book($title);
    $new_book->save();
    // create new author from user entry "add book"
    // possibly check that the author is already in the database - NOT NOW
    $name_array = explode(',', $_POST['name']);
    foreach ($name_array as $name) {
        $new_author = new Author($name);
        $new_author->save();
        $new_book->addAuthor($new_author);
開發者ID:kevintokheim,項目名稱:Library,代碼行數:31,代碼來源:app.php


注:本文中的Book::deleteAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。