當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。