本文整理汇总了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();
}
示例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');
}
示例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']));
}
示例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.");
}
示例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();
示例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();
}
示例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();
}