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


PHP TagPeer::doDeleteAll方法代码示例

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


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

示例1: foreach

foreach ($tags_triple as $tag) {
    $result[] = $tag->getName();
}
$t->ok($result === array('ns:key=value', 'ns:key=tutu', 'ns:key=titi', 'ns:key=toto'), 'it is possible to search for triple tags by key.');
$tags_triple = TagPeer::getAll(null, array('triple' => true, 'value' => 'tutu'));
$result = array();
foreach ($tags_triple as $tag) {
    $result[] = $tag->getName();
}
$t->ok($result === array('ns:key=tutu'), 'it is possible to search for triple tags by value.');
$objects_triple = TagPeer::getTaggedWith(array(), array('namespace' => 'ns', 'model' => 'Post'));
$t->ok(count($objects_triple) == 1, 'it is possible to retrieve objects tagged with certain triple tags.');
// these tests check for the behavior of the triple tags when the plugin is set
// up so that namespace:key is a unique key
// clean the database
TagPeer::doDeleteAll();
TaggingPeer::doDeleteAll();
call_user_func(array(_create_object()->getPeer(), 'doDeleteAll'));
sfConfig::set('app_deppPropelActAsTaggableBehaviorPlugin_triple_distinct', true);
$t->diag('querying triple tagging');
$object = _create_object();
$object->addTag('tutu');
$object->save();
$object = _create_object();
$object->addTag('ns:key=value');
$object->addTag('ns:key=tutu');
$object->addTag('ns:key=titi');
$object->addTag('ns:second_key=toto');
$object->save();
$tags_triple = TagPeer::getAll(null, array('triple' => true, 'namespace' => 'ns'));
$t->ok(count($tags_triple) == 2, 'it is possible to set up the plugin so that namespace:key is a unique key.');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:deppPropelActAsTaggableBehaviorTest.php


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