本文整理汇总了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());
}
}
示例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();
}