MediaWiki REL1_39
MediaWiki\User\UserOptionsLookup Class Reference

Provides access to user options. More...

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

Public Member Functions

 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.
 
 getDefaultOptions ()
 Combine the language default options with any site-specific options and add the default language variants.
 
 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.
 
 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 Attributes

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)
 

Detailed Description

Provides access to user options.

Since
1.35

Definition at line 29 of file UserOptionsLookup.php.

Member Function Documentation

◆ getBoolOption()

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.

Parameters
UserIdentity$userThe user to get the option for
string$onameThe option to check
int$queryFlagsA bit field composed of READ_XXX flags
Returns
bool User's current value for the option
See also
getOption()

Definition at line 100 of file UserOptionsLookup.php.

◆ getDefaultOption()

MediaWiki\User\UserOptionsLookup::getDefaultOption ( string $opt)

Get a given default option value.

Parameters
string$optName of option to retrieve
Returns
mixed|null Default option value

Definition at line 50 of file UserOptionsLookup.php.

References MediaWiki\User\UserOptionsLookup\getDefaultOptions().

◆ getDefaultOptions()

MediaWiki\User\UserOptionsLookup::getDefaultOptions ( )
abstract

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

Returns
array

Reimplemented in MediaWiki\User\DefaultOptionsLookup, MediaWiki\User\StaticUserOptionsLookup, and MediaWiki\User\UserOptionsManager.

Referenced by MediaWiki\User\UserOptionsLookup\getDefaultOption().

◆ getIntOption()

MediaWiki\User\UserOptionsLookup::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.

Parameters
UserIdentity$userThe user to get the option for
string$onameThe option to check
int$defaultOverrideA default value returned if the option does not exist
int$queryFlagsA bit field composed of READ_XXX flags
Returns
int User's current value for the option
See also
getOption()

Definition at line 119 of file UserOptionsLookup.php.

◆ getOption()

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

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 in MediaWiki\User\DefaultOptionsLookup, MediaWiki\User\StaticUserOptionsLookup, and MediaWiki\User\UserOptionsManager.

Referenced by SpecialEmailUser\validateTarget().

◆ getOptions()

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

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 in MediaWiki\User\DefaultOptionsLookup, MediaWiki\User\StaticUserOptionsLookup, and MediaWiki\User\UserOptionsManager.

Member Data Documentation

◆ EXCLUDE_DEFAULTS

const MediaWiki\User\UserOptionsLookup::EXCLUDE_DEFAULTS = 1

Exclude user options that are set to their default value.

Definition at line 34 of file UserOptionsLookup.php.


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