當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TagPeer::getAll方法代碼示例

本文整理匯總了PHP中TagPeer::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP TagPeer::getAll方法的具體用法?PHP TagPeer::getAll怎麽用?PHP TagPeer::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TagPeer的用法示例。


在下文中一共展示了TagPeer::getAll方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: executeEditableTagsAutocomplete

 public function executeEditableTagsAutocomplete()
 {
     $this->my_str = $this->getRequestParameter('value');
     $c = new Criteria();
     $c->add(TagPeer::TRIPLE_VALUE, $this->my_str . "%", Criteria::LIKE);
     $this->tags = TagPeer::getAll($c);
 }
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:7,代碼來源:BasedeppTaggingActions.class.php

示例2: executeUsertagsAutocomplete

 public function executeUsertagsAutocomplete()
 {
     $this->my_str = $this->getRequestParameter('value');
     $c = new Criteria();
     $c->add(TagPeer::TRIPLE_VALUE, $this->my_str . "%", Criteria::LIKE);
     $c->setLimit(10);
     $this->tags = TagPeer::getAll($c, array('is_triple' => true, 'return' => 'value'));
 }
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:8,代碼來源:actions.class.php

示例3: _create_object

$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.');
$object2 = _create_object();
$object2->addTag('ns:key=value');
$object2->addTag('ns:second_key=toto');
$object2->save();
$tags_triple = TagPeer::getAll(null, array('triple' => true, 'namespace' => 'ns'));
$t->ok(count($tags_triple) == 3, 'it is possible to apply triple tags to various objects when the plugin is set up so that namespace:key is a unique key.');
// test object creation
function _create_object()
{
    $classname = TEST_CLASS;
    if (!class_exists($classname)) {
        throw new Exception(sprintf('Unknow class "%s"', $classname));
    }
    return new $classname();
}
// second type of test object creation
function _create_object_2()
{
    $classname = TEST_CLASS_2;
    if (!class_exists($classname)) {
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:31,代碼來源:deppPropelActAsTaggableBehaviorTest.php

示例4: array

$t->ok(!in_array('ns:key=value', $result), 'triple tags are not returned when searching for normal ones.');
// these tests the search of specific triple tags parts
$t->diag('searching for specific parts of triple');
$tags_triple = TagPeer::getAll(null, array('triple' => true, 'namespace' => 'ns'));
$result = array();
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 namespace.');
$tags_triple = TagPeer::getAll(null, array('triple' => true, 'key' => 'key'));
$result = array();
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.');
// test object creation
function _create_object()
{
    $classname = TEST_CLASS;
    if (!class_exists($classname)) {
        throw new Exception(sprintf('Unknow class "%s"', $classname));
    }
    return new $classname();
}
// second type of test object creation
開發者ID:sgrove,項目名稱:cothinker,代碼行數:31,代碼來源:sfPropelActAsTaggableBehaviorTest.php


注:本文中的TagPeer::getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。