MediaWiki REL1_39
MediaWiki\User\DefaultOptionsLookup Class Reference

A service class to control default user options. More...

Inheritance diagram for MediaWiki\User\DefaultOptionsLookup:
Collaboration diagram for MediaWiki\User\DefaultOptionsLookup:

Public Member Functions

 __construct (ServiceOptions $options, Language $contentLang, HookContainer $hookContainer, NamespaceInfo $nsInfo)
 
 getDefaultOptions ()
 Combine the language default options with any site-specific options and add the default language variants.
Returns
array

 
 getOption (UserIdentity $user, string $oname, $defaultOverride=null, bool $ignoreHidden=false, int $queryFlags=self::READ_NORMAL)
 Get the user's current setting for a given option.
Parameters
UserIdentity$userThe user to get the option for
string$onameThe option to check
mixed | null$defaultOverrideA default value returned if the option does not exist
bool$ignoreHiddenWhether to ignore the effects of $wgHiddenPrefs
int$queryFlagsA bit field composed of READ_XXX flags
Returns
mixed|null User's current value for the option
See also
getBoolOption()
getIntOption()

 
 getOptions (UserIdentity $user, int $flags=0, int $queryFlags=self::READ_NORMAL)
 Get all user's options.
Parameters
UserIdentity$userThe user to get the option for
int$flagsBitwise combination of: UserOptionsManager::EXCLUDE_DEFAULTS Exclude user options that are set to the default value.
int$queryFlagsA bit field composed of READ_XXX flags
Returns
array

 
- Public Member Functions inherited from MediaWiki\User\UserOptionsLookup
 getBoolOption (UserIdentity $user, string $oname, int $queryFlags=self::READ_NORMAL)
 Get the user's current setting for a given option, as a boolean value.
 
 getDefaultOption (string $opt)
 Get a given default option value.
 
 getIntOption (UserIdentity $user, string $oname, int $defaultOverride=0, int $queryFlags=self::READ_NORMAL)
 Get the user's current setting for a given option, as an integer value.
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 
- Public Attributes inherited from MediaWiki\User\UserOptionsLookup
const EXCLUDE_DEFAULTS = 1
 Exclude user options that are set to their default value.
 
- Public Attributes inherited from IDBAccessObject
const READ_NONE = -1
 Constants for object loading bitfield flags (higher => higher QoS)
 

Protected Attributes

NamespaceInfo $nsInfo
 

Detailed Description

A service class to control default user options.

Since
1.35

Definition at line 37 of file DefaultOptionsLookup.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\DefaultOptionsLookup::__construct ( ServiceOptions $options,
Language $contentLang,
HookContainer $hookContainer,
NamespaceInfo $nsInfo )
Parameters
ServiceOptions$options
Language$contentLang
HookContainer$hookContainer
NamespaceInfo$nsInfo

Definition at line 69 of file DefaultOptionsLookup.php.

References MediaWiki\User\DefaultOptionsLookup\$nsInfo, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ getDefaultOptions()

MediaWiki\User\DefaultOptionsLookup::getDefaultOptions ( )

Combine the language default options with any site-specific options and add the default language variants.

Returns
array

Reimplemented from MediaWiki\User\UserOptionsLookup.

Definition at line 85 of file DefaultOptionsLookup.php.

◆ getOption()

MediaWiki\User\DefaultOptionsLookup::getOption ( UserIdentity $user,
string $oname,
$defaultOverride = null,
bool $ignoreHidden = false,
int $queryFlags = self::READ_NORMAL )

Get the user's current setting for a given option.

Parameters
UserIdentity$userThe user to get the option for
string$onameThe option to check
mixed | null$defaultOverrideA default value returned if the option does not exist
bool$ignoreHiddenWhether to ignore the effects of $wgHiddenPrefs
int$queryFlagsA bit field composed of READ_XXX flags
Returns
mixed|null User's current value for the option
See also
getBoolOption()
getIntOption()

Reimplemented from MediaWiki\User\UserOptionsLookup.

Definition at line 118 of file DefaultOptionsLookup.php.

◆ getOptions()

MediaWiki\User\DefaultOptionsLookup::getOptions ( UserIdentity $user,
int $flags = 0,
int $queryFlags = self::READ_NORMAL )

Get all user's options.

Parameters
UserIdentity$userThe user to get the option for
int$flagsBitwise combination of: UserOptionsManager::EXCLUDE_DEFAULTS Exclude user options that are set to the default value.
int$queryFlagsA bit field composed of READ_XXX flags
Returns
array

Reimplemented from MediaWiki\User\UserOptionsLookup.

Definition at line 132 of file DefaultOptionsLookup.php.

Member Data Documentation

◆ $nsInfo

NamespaceInfo MediaWiki\User\DefaultOptionsLookup::$nsInfo
protected

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\User\DefaultOptionsLookup::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const DefaultUserOptions
Name constant for the DefaultUserOptions setting, for use with Config::get()
const DefaultSkin
Name constant for the DefaultSkin setting, for use with Config::get()
const NamespacesToBeSearchedDefault
Name constant for the NamespacesToBeSearchedDefault setting, for use with Config::get()
Access: internal
For use by ServiceWiring

Definition at line 42 of file DefaultOptionsLookup.php.


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