MediaWiki  master
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. More...
 
 getDefaultOption (string $opt)
 Get a given default option value. More...
 
 getDefaultOptions ()
 Combine the language default options with any site-specific options and add the default language variants. More...
 
 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. More...
 
 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. More...
 
 getOptions (UserIdentity $user, int $flags=0, int $queryFlags=self::READ_NORMAL)
 Get all user's options. More...
 

Public Attributes

const EXCLUDE_DEFAULTS = 1
 Exclude user options that are set to their default value. More...
 
- Public Attributes inherited from IDBAccessObject
const READ_LOCKING = self::READ_LATEST | 2
 Constants for object loading bitfield flags (higher => higher QoS) More...
 
const READ_NONE = -1
 

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 97 of file UserOptionsLookup.php.

References MediaWiki\User\UserOptionsLookup\getOption().

◆ getDefaultOption()

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

Get a given default option value.

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

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

◆ getDefaultOptions()

MediaWiki\User\UserOptionsLookup::getDefaultOptions ( )
abstract

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

Returns
array Array of String options

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

◆ 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 116 of file UserOptionsLookup.php.

References MediaWiki\User\UserOptionsLookup\getOption().

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

Referenced by MediaWiki\User\UserOptionsLookup\getBoolOption(), and MediaWiki\User\UserOptionsLookup\getIntOption().

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

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: