|
MediaWiki master
|
Public Member Functions | |
| __construct (ServiceOptions $options, private readonly ObjectFactory $objectFactory,) | |
| getFirstRegistration (UserIdentity $user) | |
| Find the first registration timestamp for a given user. | |
| getFirstRegistrationBatch (iterable $users) | |
| Get the first registration timestamp for a batch of users. | |
| getRegistration (UserIdentity $user, string $type=LocalUserRegistrationProvider::TYPE) | |
| getRegistrationBatch (iterable $users, string $type=LocalUserRegistrationProvider::TYPE) | |
| Get the registration timestamp for a batch of users. | |
| isRegistered (string $type) | |
| Is a registration provider registered? | |
| setCachedRegistration (UserIdentity $user, string|null|false $timestamp, string $type=LocalUserRegistrationProvider::TYPE) | |
| Sets the cached registration timestamp for a given user. | |
Definition at line 17 of file UserRegistrationLookup.php.
| MediaWiki\User\Registration\UserRegistrationLookup::__construct | ( | ServiceOptions | $options, |
| private readonly ObjectFactory | $objectFactory ) |
Definition at line 36 of file UserRegistrationLookup.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\Config\ServiceOptions\get(), and MediaWiki\MainConfigNames\UserRegistrationProviders.
| MediaWiki\User\Registration\UserRegistrationLookup::getFirstRegistration | ( | UserIdentity | $user | ) |
Find the first registration timestamp for a given user.
Note this invokes all registered providers (via cache). Overall result is not cached.
| UserIdentity | $user |
Definition at line 147 of file UserRegistrationLookup.php.
References getRegistration().
| MediaWiki\User\Registration\UserRegistrationLookup::getFirstRegistrationBatch | ( | iterable | $users | ) |
Get the first registration timestamp for a batch of users.
This invokes all registered providers and doesn't use caching.
| iterable<UserIdentity> | $users |
Definition at line 175 of file UserRegistrationLookup.php.
| MediaWiki\User\Registration\UserRegistrationLookup::getRegistration | ( | UserIdentity | $user, |
| string | $type = LocalUserRegistrationProvider::TYPE ) |
| UserIdentity | $user | User for which registration should be fetched. |
| string | $type | Name of a registered registration provider |
Definition at line 81 of file UserRegistrationLookup.php.
References if, and MediaWiki\User\Registration\LocalUserRegistrationProvider\TYPE.
Referenced by getFirstRegistration().
| MediaWiki\User\Registration\UserRegistrationLookup::getRegistrationBatch | ( | iterable | $users, |
| string | $type = LocalUserRegistrationProvider::TYPE ) |
Get the registration timestamp for a batch of users.
This skips the in-process cache (the batched query takes approx. the same time for any reasonable amount of users; cache would only give us a benefit if all $users were a cache hit, which is extremely unlikely).
| iterable<UserIdentity> | $users | |
| string | $type | Name of a registered registration provider |
Definition at line 110 of file UserRegistrationLookup.php.
References return, and MediaWiki\User\Registration\LocalUserRegistrationProvider\TYPE.
| MediaWiki\User\Registration\UserRegistrationLookup::isRegistered | ( | string | $type | ) |
Is a registration provider registered?
| string | $type |
Definition at line 52 of file UserRegistrationLookup.php.
References return.
Referenced by setCachedRegistration().
| MediaWiki\User\Registration\UserRegistrationLookup::setCachedRegistration | ( | UserIdentity | $user, |
| string|null|false | $timestamp, | ||
| string | $type = LocalUserRegistrationProvider::TYPE ) |
Sets the cached registration timestamp for a given user.
Can only be used to set the date for registered users. If the size of the cache exceeds CACHE_MAX_SIZE, the least recently used entry is evicted.
Definition at line 124 of file UserRegistrationLookup.php.
References if, isRegistered(), and MediaWiki\User\Registration\LocalUserRegistrationProvider\TYPE.