MediaWiki REL1_39
|
A UserOptionsLookup that's just an array. More...
Public Member Functions | ||||||||||||||||
__construct (array $userMap, array $defaults=[]) | ||||||||||||||||
getDefaultOptions () | ||||||||||||||||
Combine the language default options with any site-specific options and add the default language variants.
| ||||||||||||||||
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.
| ||||||||||||||||
getOptions (UserIdentity $user, int $flags=0, int $queryFlags=self::READ_NORMAL) | ||||||||||||||||
Get all user's options.
| ||||||||||||||||
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. | ||||||||||||||||
Additional Inherited Members | |
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) | |
A UserOptionsLookup that's just an array.
Useful for testing and creating staging environments. Note that unlike UserOptionsManager, no attempt is made to canonicalize user names.
Definition at line 10 of file StaticUserOptionsLookup.php.
MediaWiki\User\StaticUserOptionsLookup::__construct | ( | array | $userMap, |
array | $defaults = [] ) |
array[] | $userMap | User options, username => [ option name => value ] |
mixed[] | $defaults | Defaults for each option, option name => value |
Definition at line 22 of file StaticUserOptionsLookup.php.
MediaWiki\User\StaticUserOptionsLookup::getDefaultOptions | ( | ) |
Combine the language default options with any site-specific options and add the default language variants.
Reimplemented from MediaWiki\User\UserOptionsLookup.
Definition at line 28 of file StaticUserOptionsLookup.php.
MediaWiki\User\StaticUserOptionsLookup::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.
UserIdentity | $user | The user to get the option for |
string | $oname | The option to check |
mixed | null | $defaultOverride | A default value returned if the option does not exist |
bool | $ignoreHidden | Whether to ignore the effects of $wgHiddenPrefs |
int | $queryFlags | A bit field composed of READ_XXX flags |
Reimplemented from MediaWiki\User\UserOptionsLookup.
Definition at line 33 of file StaticUserOptionsLookup.php.
MediaWiki\User\StaticUserOptionsLookup::getOptions | ( | UserIdentity | $user, |
int | $flags = 0, | ||
int | $queryFlags = self::READ_NORMAL ) |
Get all user's options.
UserIdentity | $user | The user to get the option for |
int | $flags | Bitwise combination of: UserOptionsManager::EXCLUDE_DEFAULTS Exclude user options that are set to the default value. |
int | $queryFlags | A bit field composed of READ_XXX flags |
Reimplemented from MediaWiki\User\UserOptionsLookup.
Definition at line 49 of file StaticUserOptionsLookup.php.
References MediaWiki\User\UserIdentity\getName().