当前位置: 首页>>代码示例>>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;未经允许,请勿转载。