MediaWiki  master
MediaWiki\User\UserIdentity Interface Reference

Interface for objects representing user identity. More...

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

Public Member Functions

 equals (UserIdentity $user)
 
 getActorId ( $wikiId=self::LOCAL)
 
 getId ( $wikiId=self::LOCAL)
 
 getName ()
 
 isRegistered ()
 
- Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity
 assertWiki ( $wikiId)
 Throws if $wikiId is different from the return value of getWikiId(). More...
 
 getWikiId ()
 Get the ID of the wiki this page belongs to. More...
 

Detailed Description

Interface for objects representing user identity.

This represents the identity of a user in the context of page revisions and log entries.

Note
Starting MediaWiki 1.37, UserIdentity objects should no longer expose an actor ID. The actor ID is considered a storage layer optimization and should not be exposed to and used by application logic. Storage layer code should use ActorNormalization to get an actor ID for a UserIdentity.
Since
1.31

Definition at line 39 of file UserIdentity.php.

Member Function Documentation

◆ equals()

MediaWiki\User\UserIdentity::equals ( UserIdentity  $user)
Since
1.32
Parameters
UserIdentity$user
Returns
bool

Implemented in MediaWiki\User\UserIdentityValue, and User.

◆ getActorId()

MediaWiki\User\UserIdentity::getActorId (   $wikiId = self::LOCAL)
Since
1.31
Parameters
string | false$wikiIdThe wiki ID expected by the caller. Use self::LOCAL for the local wiki.
Deprecated:
since 1.36, use ActorNormalization::findActorId() instead.
Returns
int The user's actor ID. May be 0 if no actor ID is set.
Note
This will trigger a deprecation warning when $wikiId mismatches $this->getWikiId(). In the future, it will throw PreconditionException.

Implemented in MediaWiki\User\UserIdentityValue, and User.

◆ getId()

MediaWiki\User\UserIdentity::getId (   $wikiId = self::LOCAL)
Since
1.31
Parameters
string | false$wikiIdThe wiki ID expected by the caller
Returns
int The user ID. May be 0 for anonymous users or for users with no local account.

Implemented in MediaWiki\User\UserIdentityValue, and User.

Referenced by MediaWiki\User\ActorStore\acquireActorId(), MediaWiki\Permissions\PermissionManager\addTemporaryUserRights(), MediaWiki\User\ActorStore\addUserIdentityToCache(), MediaWiki\User\UserGroupManager\addUserToAutopromoteOnceGroups(), MediaWiki\User\UserGroupManager\addUserToGroup(), WatchedItemStore\addWatchBatchForUser(), MediaWiki\Block\BlockPermissionChecker\checkBlockPermissions(), MediaWiki\User\WatchlistNotificationManager\clearAllUserNotifications(), MediaWiki\User\UserEditTracker\clearUserEditCache(), WatchedItemStore\clearUserWatchedItems(), WatchedItemStore\countUnreadNotifications(), WatchedItemStore\countWatchedItems(), WikiPage\doDeleteArticleBatched(), WikiPage\doUpdateRestrictions(), WatchedItemStore\fetchWatchedItems(), WatchedItemStore\getCacheKey(), ActorMigration\getInsertValues(), ActorMigration\getInsertValuesWithTempTable(), WatchedItemStore\getNotificationTimestampsBatch(), WatchedItemStore\getPageSeenTimestampsKey(), MediaWiki\User\TalkPageNotificationManager\getQueryFieldAndId(), MediaWiki\User\WatchlistNotificationManager\getTitleNotificationTimestamp(), UploadBase\getUploadSessionKey(), MediaWiki\User\UserEditTracker\getUserEditCount(), MediaWiki\User\UserEditTracker\getUserEditTimestamp(), MediaWiki\User\UserGroupManager\getUserFormerGroups(), MediaWiki\User\UserGroupManager\getUserGroupMemberships(), MediaWiki\Permissions\PermissionManager\getUserPermissions(), WatchedItemQueryService\getWatchedItemsForUserQueryConds(), WatchedItemQueryService\getWatchlistOwnerId(), MediaWiki\User\UserEditTracker\initializeUserEditCount(), MediaWiki\User\UserOptionsManager\loadUserOptions(), LogFormatter\makeUserLink(), RecentChange\newForCategorization(), ClearUserWatchlistJob\newForUser(), MediaWiki\User\UserFactory\newFromUserIdentity(), MediaWiki\User\UserGroupManager\removeUserFromGroup(), WatchedItemStore\removeWatchBatchForUser(), WatchedItemStore\resetAllNotificationTimestampsForUser(), WatchedItemStore\resetNotificationTimestamp(), MediaWiki\User\UserOptionsManager\saveOptions(), WatchedItemStore\setNotificationTimestampsForUser(), WatchedItemStore\uncache(), WatchedItemStore\uncacheAllItemsForUser(), WatchedItemStore\uncacheUser(), and WatchedItemStore\updateNotificationTimestamp().

◆ getName()

◆ isRegistered()

MediaWiki\User\UserIdentity::isRegistered ( )
Since
1.34
Returns
bool True if user is registered on this wiki, i.e., has a user ID. False if user is anonymous or has no local account (which can happen when importing). This must be equivalent to getId() != 0 and is provided for code readability.

Implemented in MediaWiki\User\UserIdentityValue, and User.

Referenced by MediaWiki\User\UserGroupManager\addUserToGroup(), WatchedItemStore\addWatchBatchForUser(), MediaWiki\User\UserOptionsManager\canUseCachedValues(), MediaWiki\User\UserGroupManager\canUseCachedValues(), MediaWiki\User\WatchlistNotificationManager\clearTitleUserNotifications(), MediaWiki\User\UserEditTracker\clearUserEditCache(), MediaWiki\Block\BlockManager\getBlockFromCookieValue(), MediaWiki\User\TalkPageNotificationManager\getCacheKey(), MediaWiki\User\UserGroupManager\getCacheKey(), MediaWiki\User\UserOptionsManager\getCacheKey(), WatchedItemStore\getNotificationTimestampsBatch(), MediaWiki\User\StaticUserOptionsLookup\getOptions(), MediaWiki\User\TalkPageNotificationManager\getQueryFieldAndId(), MediaWiki\Permissions\PermissionManager\getRightsCacheKey(), MediaWiki\User\UserGroupManager\getUserFormerGroups(), MediaWiki\User\UserGroupManager\getUserGroupMemberships(), MediaWiki\User\UserGroupManager\getUserImplicitGroups(), MediaWiki\Permissions\PermissionManager\getUserPermissions(), Parser\getUserSig(), WatchedItemStore\getWatchedItem(), WatchedItemQueryService\getWatchedItemsForUser(), MediaWiki\User\TalkPageNotificationManager\isTalkDisabled(), MediaWiki\User\UserOptionsManager\loadUserOptions(), WatchedItemStore\loadWatchedItemsBatch(), LogFormatter\makeUserLink(), MediaWiki\User\UserGroupManager\removeUserFromGroup(), WatchedItemStore\removeWatchBatchForUser(), WatchedItemStore\resetAllNotificationTimestampsForUser(), WatchedItemStore\resetNotificationTimestamp(), MediaWiki\User\UserOptionsManager\saveOptions(), WatchedItemStore\setNotificationTimestampsForUser(), and MediaWiki\User\DefaultOptionsLookup\verifyUsable().


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