當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。