MediaWiki master
MediaWiki\User\Options\UserOptionsStore Interface Reference

Inherited by MediaWiki\User\Options\LocalUserOptionsStore.

Public Member Functions

 fetch (UserIdentity $user, int $recency)
 Fetch all options for a given user from the store.
 
 store (UserIdentity $user, array $updates)
 Process a batch of option updates.
 

Detailed Description

Since
1.43
Stability: stable
to implement

Definition at line 11 of file UserOptionsStore.php.

Member Function Documentation

◆ fetch()

MediaWiki\User\Options\UserOptionsStore::fetch ( UserIdentity $user,
int $recency )

Fetch all options for a given user from the store.

Note that OptionsStore does not handle fallback to default. Options are either present or absent.

Parameters
UserIdentity$userA user with a non-zero ID
int$recencya bit field composed of READ_XXX flags
Returns
array<string,string>

Implemented in MediaWiki\User\Options\LocalUserOptionsStore.

◆ store()

MediaWiki\User\Options\UserOptionsStore::store ( UserIdentity $user,
array $updates )

Process a batch of option updates.

The store may assume that fetch() was previously called with a recency sufficient to provide reference values for a differential update. It is the caller's responsibility to manage recency.

Note that OptionsStore does not have a concept of defaults. The store is not required to check whether the value matches the default.

Parameters
UserIdentity$userA user with a non-zero ID
array<string,string|null>$updates A map of option names to new values. If the value is null, the key should be deleted from the store and subsequently not returned from fetch(). Absent keys should be left unchanged.
Returns
bool Whether any change was made

Implemented in MediaWiki\User\Options\LocalUserOptionsStore.


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