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


PHP Author::deleteAll方法代碼示例

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


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

示例1: tearDown

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

示例2: tearDown

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

示例3: tearDown

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

示例4: tearDown

 protected function tearDown()
 {
     Book::deleteAll();
     Author::deleteAll();
     $GLOBALS['DB']->exec("DELETE FROM authors_books;");
     $GLOBALS['DB']->exec("DELETE FROM copies;");
 }
開發者ID:jcubed22,項目名稱:library-1,代碼行數:7,代碼來源:BookTest.php

示例5: testDeleteAll

 function testDeleteAll()
 {
     $author_name = "Murakami";
     $id = 1;
     $test_author = new Author($author_name, $id);
     $test_author->save();
     $author_name = "Linux";
     $test_author2 = new Author($author_name);
     $test_author2->save();
     Author::deleteAll();
     $result = Author::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:jschold,項目名稱:Library,代碼行數:13,代碼來源:AuthorTest.php

示例6: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $name = "Bob";
     $test_author = new Author($name);
     $test_author->save();
     $name2 = "Billy Bob";
     $test_author2 = new Author($name2);
     $test_author2->save();
     //Act
     Author::deleteAll();
     $result = Author::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:r-hills,項目名稱:Library,代碼行數:15,代碼來源:AuthorTest.php

示例7: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $name = "Intro to Art";
     $test_author = new Author($name);
     $test_author->save();
     $name2 = "Intro to Spanish";
     $test_author2 = new Author($name2);
     $test_author2->save();
     //Act
     Author::deleteAll();
     $result = Author::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:kevintokheim,項目名稱:Library,代碼行數:15,代碼來源:AuthorTest.php

示例8: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $id = null;
     $name = "Lemony Snicket";
     $test_author = new Author($id, $name);
     $test_author->save();
     $name2 = "J.R.R. Tolkien";
     $test_author2 = new Author($id, $name2);
     $test_author2->save();
     //Act
     Author::deleteAll();
     //Assert
     $result = Author::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:kellimargaret,項目名稱:2015.08.26.Library,代碼行數:16,代碼來源:AuthorTest.php

示例9: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $name = "Nathan Young";
     $id = null;
     $test_author = new Author($name, $id);
     $test_author->save();
     $name2 = "Kyle Pratuch";
     $test_author2 = new Author($name2, $id);
     $test_author2->save();
     //Act
     Author::deleteAll();
     //Assert
     $result = Author::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:nathanhwyoung,項目名稱:Library,代碼行數:16,代碼來源:AuthorTest.php

示例10: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $name = "JK Rowling";
     $id = 1;
     $test_author = new Author($name, $id);
     $test_author->save();
     $name2 = "George RR Martin";
     $id2 = 2;
     $test_author2 = new Author($name, $id);
     $test_author2->save();
     //Act
     Author::deleteAll();
     $result = Author::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:bborealis,項目名稱:library,代碼行數:17,代碼來源:AuthorTest.php

示例11: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $name = "Paul Jones";
     $id = 1;
     $name2 = "Steve Smith";
     $id2 = 2;
     $test_author = new Author($name, $id);
     $test_author->save();
     $test_author2 = new Author($name, $id2);
     $test_author2->save();
     //Act
     Author::deleteAll();
     $result = Author::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:bborealis,項目名稱:library-1,代碼行數:17,代碼來源:AuthorTest.php

示例12: array

$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
$app->get("/", function () use($app) {
    return $app['twig']->render('index.html.twig', array('books' => Book::getAll(), 'authors' => Author::getAll()));
});
$app->get("/books", function () use($app) {
    return $app['twig']->render('books.html.twig', array('books' => Book::getAll()));
});
$app->post("/books", function () use($app) {
    $book_title = $_POST['book_title'];
    $book = new Book($book_title);
    $book->save();
    return $app['twig']->render('books.html.twig', array('books' => Book::getAll()));
});
$app->post("/delete_books", function () use($app) {
    Book::deleteAll();
    return $app['twig']->render('books.html.twig', array('books' => Book::getAll()));
});
$app->get("/authors", function () use($app) {
    return $app['twig']->render('authors.html.twig', array('authors' => Author::getAll()));
});
$app->post("/authors", function () use($app) {
    $name = $_POST['name'];
    $author = new Author($name);
    $author->save();
    return $app['twig']->render('authors.html.twig', array('authors' => Author::getAll()));
});
$app->post("/delete_authors", function () use($app) {
    Author::deleteAll();
    return $app['twig']->render('authors.html.twig', array('authors' => Author::getAll()));
});
return $app;
開發者ID:nathanhwyoung,項目名稱:Library-2,代碼行數:31,代碼來源:app.php

示例13: tearDown

 protected function tearDown()
 {
     Book::deleteAll();
     Author::deleteAll();
     BookList::deleteAll();
 }
開發者ID:kennygrage,項目名稱:epicLibrary,代碼行數:6,代碼來源:BookListTest.php

示例14: testDeleteAllWithLimitAndOrder

 public function testDeleteAllWithLimitAndOrder()
 {
     if (!$this->conn->acceptsLimitAndOrderForUpdateAndDelete()) {
         $this->markTestSkipped('Only MySQL & Sqlite accept limit/order with UPDATE clause');
     }
     $numAffected = Author::deleteAll(array('conditions' => array('parent_author_id = ?', 2), 'limit' => 1, 'order' => 'name asc'));
     $this->assertEquals(1, $numAffected);
     $this->assertTrue(strpos(Author::table()->lastSql, 'ORDER BY name asc LIMIT 1') !== false);
 }
開發者ID:ruri,項目名稱:php-activerecord-camelcased,代碼行數:9,代碼來源:ActiveRecordWriteTest.php

示例15: test_author_deleteAll

 function test_author_deleteAll()
 {
     //Arrange
     $id = 1;
     $author_name = "Whitman";
     $test_author = new Author($author_name, $id);
     $test_author->save();
     $id2 = 2;
     $author_name2 = "Twain";
     $test_author2 = new Author($author_name2, $id2);
     $test_author2->save();
     //Act
     Author::deleteAll();
     //Assert
     $result = Author::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:umamiMike,項目名稱:library-1,代碼行數:17,代碼來源:AuthorTest.php


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