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