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


PHP TagPeer::getAllWithCount方法代码示例

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


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

示例1: executeList

 public function executeList()
 {
     $this->getResponse()->setTitle('Gli argomenti discussi in Parlamento - ' . sfConfig::get('app_main_title'));
     // fetch teseo top_terms and add monitoring info
     $teseo_tts_with_counts = OppTeseottPeer::getAllWithCount();
     /*
     foreach ($teseo_tts_with_counts as $term_id => $term_data)
     {
       $teseo_tts_with_counts[$term_id]['n_monitored'] = OppTeseottPeer::countTagsUnderTermMonitoredByUser($term_id);
     }
     */
     $this->teseo_tts_with_counts = $teseo_tts_with_counts;
     $tag_count = TagPeer::getAllWithCount();
     $this->tag_count = $tag_count;
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:15,代码来源:actions.class.php

示例2: _create_object

$object3->save();
$object4 = _create_object();
$object4->addTag('tag3');
$object4->save();
$object5 = _create_object();
$object5->addTag('tag1,tag3,tag7');
$object5->save();
// getAll() test
$tags = TagPeer::getAll();
$result = array();
foreach ($tags as $tag) {
    $result[] = $tag->getName();
}
$t->ok($result == array('tag2', 'tag3', 'tag1', 'tag4', 'tag5', 'tag6', 'tag7', 'tag8'), 'all tags can be retrieved with getAll().');
// getAllWithCount() test
$tags = TagPeer::getAllWithCount();
$t->ok($tags == array('tag1' => 3, 'tag2' => 2, 'tag3' => 5, 'tag4' => 2, 'tag5' => 1, 'tag6' => 1, 'tag7' => 3, 'tag8' => 1), 'all tags can be retrieved with getAll().');
// getPopulars() test
$c = new Criteria();
$c->setLimit(3);
$tags = TagPeer::getPopulars($c);
$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');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:deppPropelActAsTaggableBehaviorTest.php

示例3: getPopulars

 /**
  * Returns the most popular tags with their associated weight. See
  * sfPropelActAsTaggableToolkit::normalize for more details.
  *
  * The first optionnal parameter permits to add some restrictions on the
  * objects the selected tags are related to.
  * The second optionnal parameter permits to restrict the tag selection with
  * different criterias
  *
  * @param      Criteria    $c
  * @param      array       $options
  * @return     array
  */
 public static function getPopulars($c = null, $options = array())
 {
     if (null === $c) {
         $c = new Criteria();
     }
     if (!$c->getLimit()) {
         $c->setLimit(sfConfig::get('app_sfPropelActAsTaggableBehaviorPlugin_limit', 100));
     }
     $all_tags = TagPeer::getAllWithCount($c, $options);
     return sfPropelActAsTaggableToolkit::normalize($all_tags);
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:24,代码来源:TagPeer.php

示例4: include_partial

<div class="row">
	<div class="twelvecol">
		
		<?php 
include_partial('tabs', array('current' => 'interessi'));
?>
		
	</div>
</div>

<div class="row">
	<div class="twelvecol">
		<a name="top"></a>
		<?php 
echo include_partial('datiStorici/searchWithAutocompleter', array('limit' => sfconfig::get('app_limit_interessi_argomento', 50), 'tags' => $tags, 'ramo' => $ramo, 'tag_count' => TagPeer::getAllWithCount()));
?>


	      <?php 
if (count($tags_ids)) {
    ?>
	        <div class="evidence-box float-container">

	          <h5 class="subsection">
	            I <?php 
    echo sfconfig::get('app_limit_interessi_argomento', 50);
    ?>
	            <?php 
    if ($ramo == 'C') {
        ?>
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:30,代码来源:interessiSuccess.php


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