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


PHP TagPeer::retrieveFirstByTripleValue方法代碼示例

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


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

示例1: executeAddTagValueToMyMonitoredTags

 public function executeAddTagValueToMyMonitoredTags()
 {
     $isAjax = $this->getRequest()->isXmlHttpRequest();
     // fetch current user profile
     $opp_user = OppUserPeer::retrieveByPK($this->getUser()->getId());
     // fetch the tag to add
     $tag_value = $this->getRequestParameter('tag_value');
     $tag = TagPeer::retrieveFirstByTripleValue($tag_value);
     // try to add tag to my monitored tags or redirect to buypage if limit reached
     if ($this->_addTagToMyMonitoredTags($tag, $opp_user) == -1) {
         $this->getUser()->setAttribute('page_before_buy', $this->getRequest()->getReferer());
         $this->redirect('@sottoscrizioni_pro');
     }
     // a tag was added, 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());
     }
     if ($isAjax) {
         $this->setTemplate('ajaxMyTags');
     } else {
         $this->redirect('monitoring/tags?user_token=' . $this->getUser()->getToken());
     }
 }
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:26,代碼來源:actions.class.php

示例2: executeShowNonleg

 public function executeShowNonleg()
 {
     $this->triple_value = $this->getRequestParameter('triple_value');
     $this->getResponse()->setTitle('Mozioni, interrogazioni, odg su ' . strtolower($this->triple_value) . ' - ' . sfConfig::get('app_main_title'));
     $this->response->addMeta('description', 'Tutti gli aggiornamenti sulle mozioni, interrogazioni, odg presentati in parlamento su ' . strtolower($this->triple_value), true);
     $this->argomento = TagPeer::retrieveFirstByTripleValue($this->triple_value);
     $this->forward404Unless(isset($this->argomento));
     $this->user = OppUserPeer::retrieveByPK($this->user_id);
     $this->session = $this->getUser();
     // reset dei filtri se richiesto esplicitamente
     if ($this->getRequestParameter('reset_filters', 'false') == 'true') {
         $this->getRequest()->getParameterHolder()->set('filter_nonleg_act_type', '0');
         $this->getRequest()->getParameterHolder()->set('filter_act_ramo', '0');
         $this->getRequest()->getParameterHolder()->set('filter_act_stato', '0');
     }
     $this->processFilters(array('act_nonleg_type', 'act_ramo', 'act_stato'));
     // if all filters were reset, then restart
     if ($this->getRequestParameter('filter_nonleg_act_type') == '0' && $this->getRequestParameter('filter_act_ramo') == '0' && $this->getRequestParameter('filter_act_stato') == '0') {
         $this->redirect('@argomento_nonleg?triple_value=' . $this->triple_value);
     }
     $this->processListSort('argomento_nonleg/sort');
     if ($this->hasRequestParameter('itemsperpage')) {
         $this->getUser()->setAttribute('itemsperpage', $this->getRequestParameter('itemsperpage'));
     }
     $itemsperpage = $this->getUser()->getAttribute('itemsperpage', sfConfig::get('app_pagination_limit'));
     $this->pager = new sfPropelPager('OppAtto', $itemsperpage);
     $c = new Criteria();
     $c->addJoin(OppAttoPeer::ID, TaggingPeer::TAGGABLE_ID);
     $c->add(TaggingPeer::TAG_ID, $this->argomento->getId());
     $c->add(TaggingPeer::TAGGABLE_MODEL, 'OppAtto');
     $this->addFiltersCriteria($c);
     $this->addListSortCriteria($c, 'argomento_nonleg/sort');
     $c->addDescendingOrderByColumn(OppAttoPeer::DATA_PRES);
     $this->pager->setCriteria($c);
     $this->pager->setPage($this->getRequestParameter('page', 1));
     $this->pager->setPeerMethod('doSelectJoinOppTipoAtto');
     $this->pager->init();
 }
開發者ID:valerio-bozzolan,項目名稱:openparlamento,代碼行數:38,代碼來源:actions.class.php


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