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


PHP ResultContext::setTypeRestriction方法代码示例

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


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

示例1: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
     $t_list = new ca_lists();
     $pn_type_restriction_id = $t_list->getItemIDFromList('occurrence_types', 'chronology');
     // set type restrictions for searches
     $o_search_result_context = new ResultContext($this->request, "ca_occurrences", 'basic_search');
     $o_search_result_context->setTypeRestriction($pn_type_restriction_id);
     $o_search_result_context->saveContext();
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:14,代码来源:ChronologyController.php

示例2: chronology

 function chronology()
 {
     $this->ops_tablename = 'ca_occurrences';
     $t_list = new ca_lists();
     $this->opn_type_restriction_id = $t_list->getItemIDFromList('occurrence_types', 'chronology');
     $va_access_values = caGetUserAccessValues($this->request);
     $this->getDefaults();
     // set type restrictions for searches
     $o_search_result_context = new ResultContext($this->request, $this->ops_tablename, 'basic_search');
     $o_search_result_context->setTypeRestriction($this->opn_type_restriction_id);
     $o_search_result_context->saveContext();
     // Set type restriction (ie. only show occurrences with type=bibliography)
     // the base browse controller Index() method will take care of actually setting the restriction
     $this->opo_result_context = new ResultContext($this->request, $this->ops_tablename, $this->ops_find_type);
     $this->opo_result_context->setTypeRestriction($this->opn_type_restriction_id);
     $this->opo_browse = new OccurrenceBrowse($this->opo_result_context->getSearchExpression(), 'pawtucket2');
     $this->opo_browse->setTypeRestrictions(array($this->opn_type_restriction_id));
     $this->opa_sorts = array('ca_occurrence_labels.name' => _t('title'), 'ca_occurrences.idno' => _t('idno'));
     // Remove any browse criteria previously set
     $this->opo_browse->removeAllCriteria();
     parent::Index(true);
     $this->render('Landing/chronology_html.php');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:23,代码来源:LandingController.php


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