CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Profile\ContextualProfileOverride Class Reference

Overrider that generates a name from a template and contextual information from the profile request. More...

+ Inheritance diagram for CirrusSearch\Profile\ContextualProfileOverride:
+ Collaboration diagram for CirrusSearch\Profile\ContextualProfileOverride:

Public Member Functions

 __construct ( $template, array $params, $priority=SearchProfileOverride::CONTEXTUAL_PRIO)
 
 priority ()
 The priority of this override, lower wins.
 
 getOverriddenName (array $contextParams)
 Get the overridden name or null if it cannot be overridden.
 
 explain ()
 

Public Attributes

const LANGUAGE = 'language'
 Language code context, defaults to current context language.
 
- Public Attributes inherited from CirrusSearch\Profile\SearchProfileOverride
const URI_PARAM_PRIO = 100
 Default priority for uri param overrides.
 
const USER_PREF_PRIO = 200
 Default priority for user pref overrides.
 
const CONTEXTUAL_PRIO = 300
 Default priority for contextual overrides.
 
const CONFIG_PRIO = 400
 Default priority for config overrides.
 

Detailed Description

Overrider that generates a name from a template and contextual information from the profile request.

Known "context values" are:

  • "language": defaults to language code from \IContextSource::getLanguage()
    See also
    \IContextSource::getLanguage()

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Profile\ContextualProfileOverride::__construct ( $template,
array $params,
$priority = SearchProfileOverride::CONTEXTUAL_PRIO )
Parameters
string$templateA templated profile name
string[]$paramsMap from string in $template to context parameter to replace with. All parameters must be available in the context parameters or no override will be applied.
int$priority

Member Function Documentation

◆ explain()

CirrusSearch\Profile\ContextualProfileOverride::explain ( )

◆ getOverriddenName()

CirrusSearch\Profile\ContextualProfileOverride::getOverriddenName ( array $contextParams)

Get the overridden name or null if it cannot be overridden.

Parameters
string[]$contextParams
Returns
string|null

Implements CirrusSearch\Profile\SearchProfileOverride.

◆ priority()

CirrusSearch\Profile\ContextualProfileOverride::priority ( )

The priority of this override, lower wins.

Returns
int

Implements CirrusSearch\Profile\SearchProfileOverride.

Member Data Documentation

◆ LANGUAGE

const CirrusSearch\Profile\ContextualProfileOverride::LANGUAGE = 'language'

Language code context, defaults to current context language.

See also
\IContextSource::getLanguage()

The documentation for this class was generated from the following file: