本文整理汇总了PHP中ArticlePeer::doDeleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticlePeer::doDeleteAll方法的具体用法?PHP ArticlePeer::doDeleteAll怎么用?PHP ArticlePeer::doDeleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticlePeer
的用法示例。
在下文中一共展示了ArticlePeer::doDeleteAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sleep
$finder->where('Title', 'bar')->findOne(); // write cache 2
$SQL1 = $finder->getLatestQuery();
$finder->where('Title', 'foo')->findOne(); // read cache 1
$SQL2 = $finder->getLatestQuery();
$t->is($SQL1, $SQL2, 'The same query asked within the lifetime uses the cache');
sleep(2);
$finder->where('Title', 'foo')->findOne(); // re-write cache 1
$SQL3 = $finder->getLatestQuery();
$t->isnt($SQL1, $SQL3, 'The same query asked after the lifetime does not use the cache');
*/
$t->diag('Cached results');
$cache->clear();
ArticlePeer::doDeleteAll();
$article1 = new Article();
$article1->setTitle('foo1');
$article1->save();
$article2 = new Article();
$article2->setTitle('foo2');
$article2->save();
$finder = DbFinder::from('Article')->useCache($cache, 10);
$finder->where('Title', 'foo1')->findOne(); // normal query
$article = $finder->where('Title', 'foo1')->findOne(); // cached query
$t->isa_ok($article, 'Article', 'Cached finder queries return Model objects');
$t->is($article->getId(), $article1->getId(), 'find() finder queries can be cached');
$finder->where('Title', 'foo1')->count(); // normal query
$nb = $finder->where('Title', 'foo1')->count(); // cached query
$t->is($nb, 1, 'count() finder queries can be cached');