本文整理汇总了PHP中TagPeer::getRelatedTags方法的典型用法代码示例。如果您正苦于以下问题:PHP TagPeer::getRelatedTags方法的具体用法?PHP TagPeer::getRelatedTags怎么用?PHP TagPeer::getRelatedTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TagPeer
的用法示例。
在下文中一共展示了TagPeer::getRelatedTags方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRelated
public function getRelated($options = array())
{
return TagPeer::getRelatedTags($this->getName());
}
示例2: array
$t->ok(array_keys($tags) == array('tag1', 'tag3', 'tag7'), 'most popular tags can be retrieved with getPopulars().');
$t->ok($tags['tag3'] >= $tags['tag1'], 'getPopulars() preserves tag importance.');
// getRelatedTags() test
$tags = TagPeer::getRelatedTags('tag8');
$t->ok(array_keys($tags) == array('tag2', 'tag3', 'tag7'), 'related tags can be retrieved with getRelatedTags().');
$c = new Criteria();
$tags = TagPeer::getRelatedTags('tag2', array('limit' => 1));
$t->ok(array_keys($tags) == array('tag3'), 'when a limit is set, only most popular related tags are returned by getRelatedTags().');
// getRelatedTags() test
$tags = TagPeer::getRelatedTags('tag7');
$t->ok(array_keys($tags) == array('tag1', 'tag2', 'tag3', 'tag4', 'tag8'), 'getRelatedTags() aggregates tags from different objects.');
// getRelatedTags() test
$tags = TagPeer::getRelatedTags(array('tag2', 'tag7'));
$t->ok(array_keys($tags) == array('tag3', 'tag8'), 'getRelatedTags() can retrieve tags related to an array of tags.');
// getRelatedTags() test
$tags = TagPeer::getRelatedTags('tag2,tag7');
$t->ok(array_keys($tags) == array('tag3', 'tag8'), 'getRelatedTags() also accepts a coma-separated string.');
// getTaggedWith() tests
$object_2_1 = _create_object_2();
$object_2_1->addTag('tag1,tag3,tag7');
$object_2_1->save();
$object_2_2 = _create_object_2();
$object_2_2->addTag('tag2,tag7');
$object_2_2->save();
$tagged_with_tag4 = TagPeer::getTaggedWith('tag4');
$t->ok(count($tagged_with_tag4) == 2, 'getTaggedWith() returns objects tagged with one specific tag.');
$tagged_with_tag7 = TagPeer::getTaggedWith('tag7');
$t->ok(count($tagged_with_tag7) == 5, 'getTaggedWith() can return several object types.');
$tagged_with_tag17 = TagPeer::getTaggedWith(array('tag1', 'tag7'));
$t->ok(count($tagged_with_tag17) == 3, 'getTaggedWith() returns objects tagged with several specific tags.');
$tagged_with_tag127 = TagPeer::getTaggedWith('tag1, tag2, tag7', array('nb_common_tags' => 2));
示例3: executeArgomenticorrelati
public function executeArgomenticorrelati()
{
$this->related_tags = TagPeer::getRelatedTags($this->tag->getName(), array('limit' => 20, 'model' => 'OppAtto'));
}