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