本文整理汇总了PHP中CategoryPeer::doDeleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP CategoryPeer::doDeleteAll方法的具体用法?PHP CategoryPeer::doDeleteAll怎么用?PHP CategoryPeer::doDeleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CategoryPeer
的用法示例。
在下文中一共展示了CategoryPeer::doDeleteAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: select
$finder = sfPropelFinder::from('Category')->
select(array('Id','Name'), sfModelFinder::SIMPLE);
$category = $finder->findOne();
$t->is_deeply(array_keys($category), array(0, 1), 'The row returned by findOne() called after select(array, sfModelFinder::SIMPLE) is an array with numeric keys');
$t->is($category[0], $category1->getId(), 'The row returned by findOne() called after select(array, sfModelFinder::SIMPLE) is an array where the values are the requested column values');
$t->is($category[1], $category1->getName(), 'The row returned by findOne() called after select(array, sfModelFinder::SIMPLE) is an array where the values are the requested column values');
/*********************************************/
/* sfPropelFinder::select() and withColumn() */
/*********************************************/
$t->diag('sfPropelFinder::select() and withColumn()');
ArticlePeer::doDeleteAll();
CategoryPeer::doDeleteAll();
$category1 = new Category();
$category1->setName('cat1');
$category1->save();
$category2 = new Category();
$category2->setName('cat2');
$category2->save();
$article1 = new Article();
$article1->setTitle('art1');
$article1->setCategory($category1);
$article1->save();
$article2 = new Article();
$article2->setTitle('art2');
$article2->setCategory($category2);
$article2->save();
$article3 = new Article();