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


PHP TagPeer::retrieveByTagname方法代碼示例

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


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

示例1: removeTagForIndex

 /**
  * Removes a tag or a set of tags from the object. As usual, the second
  * parameter might be an array of tags or a comma-separated string.
  *
  * @param      BaseObject  $object
  * @param      mixed       $tagname
  */
 public function removeTagForIndex($tagname)
 {
     $tagname = deppPropelActAsTaggableToolkit::explodeTagString($tagname);
     if (is_array($tagname)) {
         foreach ($tagname as $tag) {
             $this->removeTagForIndex($tag);
         }
     } else {
         $tagname = deppPropelActAsTaggableToolkit::cleanTagName($tagname);
         sfContext::getInstance()->getLogger()->info('{opp_debug}' . $tagname);
         $tag_object = TagPeer::retrieveByTagname($tagname);
         $tagging = TaggingForIndexPeer::retrieveByTagAndAtto($tag_object->getId(), $this->getId());
         $tagging->delete();
     }
 }
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:22,代碼來源:OppAtto.php

示例2: foreach

    Non stai monitorando nessun argomento
  <?php 
}
?>

  <div class="more-results float-container">
    <ul id="my_tags" class="monitoring-list">
      <li id="ok" style="display:none"><?php 
echo $remaining_tags;
?>
</li>
      <?php 
foreach ($my_tags as $my_tag_name => $popularity) {
    ?>
        <li title="click per visualizzare le notizie relative"> 
          <?php 
    list($tag, $ns, $key, $value) = deppPropelActAsTaggableToolkit::extractTriple($my_tag_name);
    $tag_id = TagPeer::retrieveByTagname($my_tag_name);
    echo link_to(strtolower($value), '@news_tag?id=' . $tag_id->getId(), array('class' => 'folk' . ($popularity + 3)));
    ?>
          <?php 
    echo link_to('x', '@removeTagFromMyMonitoredTags?name=' . $tag, array('class' => 'ico-stop_monitoring', 'title' => 'smetti di monitorare questo argomento'));
    ?>
        </li>
      <?php 
}
?>
    </ul>
  </div>
</div>
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:30,代碼來源:_tagsMonitoredByUser.php

示例3: executeRemoveTagFromMyMonitoredTags

 public function executeRemoveTagFromMyMonitoredTags()
 {
     $isAjax = $this->getRequest()->isXmlHttpRequest();
     // remove the tag from the monitored pool
     $tag_name = $this->getRequestParameter('name');
     $tag = TagPeer::retrieveByTagname($tag_name);
     $tag->removeMonitoringUser($this->getUser()->getId());
     // fetch current user profile and the number of tags the user can still add to the pool
     $opp_user = OppUserPeer::retrieveByPK($this->getUser()->getId());
     $this->remaining_tags = $opp_user->getNMaxMonitoredTags() - $opp_user->countMonitoredObjects('Tag');
     // fetch the monitored pool
     $c = new Criteria();
     $c->add(TagPeer::ID, $opp_user->getMonitoredPks('Tag'), Criteria::IN);
     $this->my_tags = TagPeer::getPopulars($c, array('limit' => 10));
     // a tag was removed, clear the cache for the news, acts and tags page
     $cacheManager = $this->getContext()->getViewCacheManager();
     if (!is_null($cacheManager)) {
         $cacheManager->remove('monitoring/news?user_token=' . $this->getUser()->getToken());
         $cacheManager->remove('monitoring/acts?user_token=' . $this->getUser()->getToken());
         $cacheManager->remove('monitoring/tags?user_token=' . $this->getUser()->getToken());
     }
     // remove the negative bookmarking from objects indirectly monitored thanks to this tag
     $indirectly_monitored_acts = OppAttoPeer::doSelectIndirectlyMonitoredByUser($opp_user, null, null, array($tag_id));
     foreach ($indirectly_monitored_acts as $act) {
         $act->removeNegativeBookmarking($this->getUser()->getId());
     }
     if ($isAjax) {
         $this->setTemplate('ajaxMyTags');
     } else {
         $this->redirect('monitoring/tags?user_token=' . $this->getUser()->getToken());
     }
 }
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:32,代碼來源:actions.class.php

示例4: executeShowFromSearch

 public function executeShowFromSearch()
 {
     if ($this->hasRequestParameter('tag_name')) {
         $argomento = TagPeer::retrieveByTagname($this->getRequestParameter('tag_name'));
     }
     $triple_value = $argomento->getTripleValue();
     $this->redirect('@argomento?triple_value=' . $triple_value);
 }
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:8,代碼來源:actions.class.php


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