当前位置: 首页>>代码示例>>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;未经允许,请勿转载。