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


PHP Results::getOptions方法代码示例

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


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

示例1: initSearchObject

 /**
  * Initialize the search object used for finding recommendations.
  *
  * @return void
  */
 protected function initSearchObject()
 {
     // Build a new search object:
     $this->searchObject = $this->resultsManager->get($this->searchClassId);
     $this->searchObject->getOptions()->spellcheckEnabled(false);
     $this->searchObject->getParams()->recommendationsEnabled(false);
 }
开发者ID:tillk,项目名称:vufind,代码行数:12,代码来源:Solr.php

示例2: getSearchParams

 /**
  * Get search parameters
  *
  * @return string of params
  */
 public function getSearchParams()
 {
     // Get search parameters and return them minus the leading ?:
     $str = substr($this->searchObject->getUrlQuery()->getParams(false), 1);
     // Pass through hidden filters:
     $options = $this->searchObject->getOptions();
     if (is_callable([$options, 'getHiddenFilters'])) {
         foreach ($options->getHiddenFilters() as $hf) {
             $str .= '&' . urlencode('hf[]') . '=' . urlencode($hf);
         }
     }
     return $str;
 }
开发者ID:tillk,项目名称:vufind,代码行数:18,代码来源:PubDateVisAjax.php

示例3: __invoke

 /**
  * Turns facet information into an alphabetical list.
  *
  * @param \VuFind\Search\Base\Results $results     Search result object
  * @param string                      $field       Facet field to sort
  * @param array                       $list        Facet value list extract from
  * the search result object's getFacetList method
  * @param array                       $searchRoute Route to use to generate
  * search URLs for individual facet values
  *
  * @return array      Associative URL => description array sorted by description
  */
 public function __invoke($results, $field, $list, $searchRoute)
 {
     $facets = [];
     // avoid limit on URL
     $results->getParams()->setLimit($results->getOptions()->getDefaultLimit());
     $urlHelper = $this->getView()->plugin('url');
     foreach ($list as $value) {
         $url = $urlHelper($searchRoute) . $results->getUrlQuery()->addFacet($field, $value['value']);
         $facets[$url] = $value['displayText'];
     }
     natcasesort($facets);
     return $facets;
 }
开发者ID:tillk,项目名称:vufind,代码行数:25,代码来源:SortFacetList.php

示例4: rememberSearch

 /**
  * Store the URL of the provided search (if appropriate).
  *
  * @param \VuFind\Search\Base\Results $results Search results object
  *
  * @return void
  */
 protected function rememberSearch($results)
 {
     // Only save search URL if the property tells us to...
     if ($this->rememberSearch) {
         $searchUrl = $this->url()->fromRoute($results->getOptions()->getSearchAction()) . $results->getUrlQuery()->getParams(false);
         $this->getSearchMemory()->rememberSearch($searchUrl);
     }
     // Always save search parameters, since these are namespaced by search
     // class ID.
     $this->getSearchMemory()->rememberParams($results->getParams());
 }
开发者ID:shemmens,项目名称:vufind,代码行数:18,代码来源:AbstractSearch.php

示例5: rememberSearch

 /**
  * Store the URL of the provided search (if appropriate).
  *
  * @param \VuFind\Search\Base\Results $results Search results object
  *
  * @return void
  */
 protected function rememberSearch($results)
 {
     if ($this->rememberSearch) {
         $searchUrl = $this->url()->fromRoute($results->getOptions()->getSearchAction()) . $results->getUrlQuery()->getParams(false);
         $this->getSearchMemory()->rememberSearch($searchUrl);
     }
 }
开发者ID:guenterh,项目名称:vufind,代码行数:14,代码来源:AbstractSearch.php

示例6: rememberSearch

 /**
  * Update the remembered "last search" in the session.
  *
  * @param \VuFind\Search\Base\Results $search Search object to remember.
  *
  * @return void
  */
 protected function rememberSearch($search)
 {
     $baseUrl = $this->getController()->url()->fromRoute($search->getOptions()->getSearchAction());
     $this->getController()->getSearchMemory()->rememberSearch($baseUrl . $search->getUrlQuery()->getParams(false));
 }
开发者ID:guenterh,项目名称:vufind,代码行数:12,代码来源:ResultScroller.php


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