当前位置: 首页>>代码示例>>PHP>>正文


PHP AuthorPeer::doDeleteAll方法代码示例

本文整理汇总了PHP中AuthorPeer::doDeleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthorPeer::doDeleteAll方法的具体用法?PHP AuthorPeer::doDeleteAll怎么用?PHP AuthorPeer::doDeleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AuthorPeer的用法示例。


在下文中一共展示了AuthorPeer::doDeleteAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: emptyTables

 protected function emptyTables()
 {
     $res1 = AuthorPeer::doDeleteAll();
     $res2 = PublisherPeer::doDeleteAll();
     $res3 = AuthorPeer::doDeleteAll();
     $res4 = ReviewPeer::doDeleteAll();
     $res5 = MediaPeer::doDeleteAll();
     $res6 = BookClubListPeer::doDeleteAll();
     $res7 = BookListRelPeer::doDeleteAll();
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:10,代码来源:speed.php

示例2: testCommitAfterFetch

 public function testCommitAfterFetch()
 {
     $con = Propel::getConnection(BookPeer::DATABASE_NAME);
     AuthorPeer::doDeleteAll($con);
     $a = new Author();
     $a->setFirstName('Test');
     $a->setLastName('User');
     $a->save($con);
     $con->beginTransaction();
     $stmt = $con->prepare('SELECT author.FIRST_NAME, author.LAST_NAME FROM author');
     $stmt->execute();
     $authorArr = array(0 => 'Test', 1 => 'User');
     $i = 0;
     $row = $stmt->fetch(PDO::FETCH_NUM);
     $stmt->closeCursor();
     $con->commit();
     $this->assertEquals($authorArr, $row, 'PDO driver supports calling $stmt->fetch before the transaction has been closed');
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:18,代码来源:PropelPDOTest.php

示例3: testFindOneWithSameRelatedObject

 /**
  * @see http://www.propelorm.org/ticket/959
  */
 public function testFindOneWithSameRelatedObject()
 {
     BookPeer::doDeleteAll();
     AuthorPeer::doDeleteAll();
     $auth = new Author();
     $auth->setFirstName('John');
     $auth->save();
     $book1 = new Book();
     $book1->setTitle('Hello');
     $book1->setAuthor($auth);
     $book1->save();
     $book2 = new Book();
     $book2->setTitle('World');
     $book2->setAuthor($auth);
     $book2->save();
     BookPeer::clearInstancePool();
     AuthorPeer::clearInstancePool();
     $c = new ModelCriteria('bookstore', 'Book');
     $c->setFormatter(ModelCriteria::FORMAT_ARRAY);
     $c->join('Book.Author');
     $c->with('Author');
     $books = $c->find();
     $this->assertEquals(2, count($books));
     $firstBook = $books[0];
     $this->assertTrue(isset($firstBook['Author']));
     $secondBook = $books[1];
     $this->assertTrue(isset($secondBook['Author']));
 }
开发者ID:keneanung,项目名称:gw2spidy,代码行数:31,代码来源:PropelArrayFormatterWithTest.php

示例4: testDoDeleteAll_SetNull

 /**
  * Test the doDeleteAll() method when onDelete="SETNULL".
  */
 public function testDoDeleteAll_SetNull()
 {
     $c = new Criteria();
     $c->add(BookPeer::AUTHOR_ID, null, Criteria::NOT_EQUAL);
     // 1) make sure there are some books with valid authors
     $this->assertTrue(count(BookPeer::doSelect($c)) > 0, "Expect some book.author_id columns that are not NULL.");
     // 2) delete all the authors
     AuthorPeer::doDeleteAll();
     // 3) now verify that the book.author_id columns are all nul
     $this->assertEquals(0, count(BookPeer::doSelect($c)), "Expect all book.author_id columns to be NULL.");
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:14,代码来源:GeneratedPeerDoDeleteTest.php

示例5: varchar

The tests expect a model similar to this one:

    propel:
      article:
        id:          ~
        title:       varchar(255)

Beware that the tables for these models will be emptied by the tests, so use a test database connection.
*/

include dirname(__FILE__).'/../../bootstrap.php';

$con = Propel::getConnection();

// cleanup database
AuthorPeer::doDeleteAll();
CommentPeer::doDeleteAll();
CategoryPeer::doDeleteAll();
ArticlePeer::doDeleteAll();

$t = new lime_test(33, new lime_output_color());

$article1 = new Article();
$article1->setTitle('tt1');
$article1->save();
$article2 = new Article();
$article2->setTitle('tt2');
$article2->save();
$article3 = new Article();
$article3->setTitle('tt3');
$article3->save();
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:31,代码来源:sfPropelFinderPagerTest.php

示例6: depopulate

 public static function depopulate()
 {
     AcctAccessRolePeer::doDeleteAll();
     AuthorPeer::doDeleteAll();
     BookstorePeer::doDeleteAll();
     BookstoreContestPeer::doDeleteAll();
     BookstoreContestEntryPeer::doDeleteAll();
     BookstoreEmployeePeer::doDeleteAll();
     BookstoreEmployeeAccountPeer::doDeleteAll();
     BookstoreSalePeer::doDeleteAll();
     BookClubListPeer::doDeleteAll();
     BookOpinionPeer::doDeleteAll();
     BookReaderPeer::doDeleteAll();
     BookListRelPeer::doDeleteAll();
     BookPeer::doDeleteAll();
     ContestPeer::doDeleteAll();
     CustomerPeer::doDeleteAll();
     MediaPeer::doDeleteAll();
     PublisherPeer::doDeleteAll();
     ReaderFavoritePeer::doDeleteAll();
     ReviewPeer::doDeleteAll();
 }
开发者ID:nhemsley,项目名称:propel,代码行数:22,代码来源:BookstoreDataPopulator.php

示例7: depopulate

 public static function depopulate($con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(BookPeer::DATABASE_NAME);
     }
     $con->beginTransaction();
     AuthorPeer::doDeleteAll($con);
     BookstorePeer::doDeleteAll($con);
     BookstoreContestPeer::doDeleteAll($con);
     BookstoreContestEntryPeer::doDeleteAll($con);
     BookstoreEmployeePeer::doDeleteAll($con);
     BookstoreEmployeeAccountPeer::doDeleteAll($con);
     BookstoreSalePeer::doDeleteAll($con);
     BookClubListPeer::doDeleteAll($con);
     BookOpinionPeer::doDeleteAll($con);
     BookReaderPeer::doDeleteAll($con);
     BookListRelPeer::doDeleteAll($con);
     BookPeer::doDeleteAll($con);
     ContestPeer::doDeleteAll($con);
     CustomerPeer::doDeleteAll($con);
     MediaPeer::doDeleteAll($con);
     PublisherPeer::doDeleteAll($con);
     ReaderFavoritePeer::doDeleteAll($con);
     ReviewPeer::doDeleteAll($con);
     $con->commit();
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:26,代码来源:BookstoreDataPopulator.php


注:本文中的AuthorPeer::doDeleteAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。