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)
 
 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 | null$user
Returns
bool

Implemented in UserRightsProxy, MediaWiki\User\UserIdentityValue, and User.

Referenced by MediaWiki\Block\BlockPermissionChecker\checkBlockPermissions().

◆ 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 UserRightsProxy, MediaWiki\User\UserIdentityValue, and User.

Referenced by UserEditCountUpdate\__construct(), MediaWiki\User\ActorStore\acquireSystemActorId(), MediaWiki\User\ActorCache\add(), MediaWiki\Permissions\PermissionManager\addTemporaryUserRights(), MediaWiki\User\UserGroupManager\addUserToAutopromoteOnceGroups(), MediaWiki\User\UserGroupManager\addUserToGroup(), WatchedItemStore\addWatchBatchForUser(), MediaWiki\Block\BlockPermissionChecker\checkBlockPermissions(), MediaWiki\User\UserEditTracker\clearUserEditCache(), WatchedItemStore\clearUserWatchedItems(), WatchedItemStore\countUnreadNotifications(), WatchedItemStore\countWatchedItems(), WikiPage\doUpdateRestrictions(), ApiBlock\execute(), WatchedItemStore\fetchWatchedItems(), MediaWiki\Block\BlockErrorFormatter\formatBlockerLink(), WatchedItemStore\getCacheKey(), ActorMigrationBase\getInsertValues(), ActorMigrationBase\getInsertValuesWithTempTable(), WatchedItemStore\getNotificationTimestampsBatch(), WatchedItemStore\getPageSeenTimestampsKey(), MediaWiki\User\TalkPageNotificationManager\getQueryFieldAndId(), MediaWiki\Watchlist\WatchlistManager\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\Revision\RevisionStore\insertIpChangesRow(), LocalIdLookup\isAttached(), MediaWiki\User\UserOptionsManager\loadOptionsFromDb(), LogFormatter\makeUserLink(), RecentChange\newForCategorization(), ClearUserWatchlistJob\newForUser(), MediaWiki\User\UserFactory\newFromUserIdentity(), MediaWiki\User\UserGroupManager\removeUserFromGroup(), WatchedItemStore\removeWatchBatchForUser(), WatchedItemStore\resetAllNotificationTimestampsForUser(), WatchedItemStore\resetNotificationTimestamp(), MediaWiki\User\UserOptionsManager\saveOptions(), MediaWiki\User\UserEditTracker\setCachedUserEditCount(), WatchedItemStore\setNotificationTimestampsForUser(), WatchedItemStore\uncache(), WatchedItemStore\uncacheAllItemsForUser(), WatchedItemStore\uncacheUser(), WatchedItemStore\updateNotificationTimestamp(), UserrightsPage\userCanChangeRights(), and MediaWiki\User\ActorStore\validateActorForInsertion().

◆ getName()

MediaWiki\User\UserIdentity::getName ( )
Since
1.31
Returns
string The user's logical name. May be an IPv4 or IPv6 address for anonymous users.

Implemented in UserRightsProxy, MediaWiki\User\UserIdentityValue, and User.

Referenced by ContribsPager\__construct(), MediaWiki\User\ActorCache\add(), CentralIdLookup\centralIdFromLocalUser(), PasswordPolicyChecks\checkPasswordCannotBeSubstringInUsername(), PasswordPolicyChecks\checkPasswordCannotMatchDefaults(), MediaWiki\Permissions\PermissionManager\checkUserConfigPermissions(), MediaWiki\User\ActorStore\deleteActor(), WikiPage\doEditUpdates(), User\equals(), MediaWiki\User\UserIdentityValue\equals(), UserRightsProxy\equals(), MediaWiki\User\ActorStore\findActorId(), MediaWiki\Block\BlockErrorFormatter\formatBlockerLink(), ApiQueryUserInfo\getCentralUserInfo(), SpecialMute\getForm(), ActorMigrationBase\getInsertValues(), ActorMigrationBase\getInsertValuesWithTempTable(), MediaWiki\User\StaticUserOptionsLookup\getOptions(), MediaWiki\User\TalkPageNotificationManager\getQueryFieldAndId(), MediaWiki\Block\AbstractBlock\getTargetName(), SpecialBlock\getTargetUserTitle(), UploadBase\getUploadSessionKey(), Parser\getUserSig(), MediaWiki\Revision\RevisionStore\insertIpChangesRow(), WikiPage\insertNullProtectionRevision(), MediaWiki\Block\AbstractBlock\isBlocking(), MediaWiki\Storage\DerivedPageDataUpdater\isReusableFor(), MediaWiki\Storage\PageEditStash\lastEditTime(), LogFormatter\makeUserLink(), RecentChange\newForCategorization(), MediaWiki\User\UserFactory\newFromUserIdentity(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), MediaWiki\Storage\DerivedPageDataUpdater\prepareUpdate(), SpecialBlock\preText(), SpecialBlock\processFormInternal(), MediaWiki\Storage\PageEditStash\pruneExcessStashedEntries(), MediaWiki\Storage\PageEditStash\recentStashEntryCount(), and MediaWiki\User\ActorStore\validateActorForInsertion().

◆ 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 UserRightsProxy, MediaWiki\User\UserIdentityValue, and User.

Referenced by MediaWiki\User\UserGroupManager\addUserToGroup(), WatchedItemStore\addWatchBatchForUser(), MediaWiki\User\UserOptionsManager\canUseCachedValues(), MediaWiki\User\UserGroupManager\canUseCachedValues(), 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\Block\BlockManager\getUserBlock(), MediaWiki\User\UserEditTracker\getUserEditCount(), MediaWiki\User\UserGroupManager\getUserFormerGroups(), MediaWiki\User\UserGroupManager\getUserGroupMemberships(), MediaWiki\User\UserGroupManager\getUserImplicitGroups(), Parser\getUserSig(), WatchedItemStore\getWatchedItem(), WatchedItemQueryService\getWatchedItemsForUser(), MediaWiki\User\UserEditTracker\incrementUserEditCount(), MediaWiki\User\TalkPageNotificationManager\isTalkDisabled(), MediaWiki\User\UserOptionsManager\loadOriginalOptions(), SpecialMute\loadTarget(), WatchedItemStore\loadWatchedItemsBatch(), CentralIdLookup\localUserFromCentralId(), LogFormatter\makeUserLink(), MediaWiki\User\UserGroupManager\removeUserFromGroup(), WatchedItemStore\removeWatchBatchForUser(), WatchedItemStore\resetAllNotificationTimestampsForUser(), WatchedItemStore\resetNotificationTimestamp(), MediaWiki\User\UserOptionsManager\saveOptions(), MediaWiki\User\UserEditTracker\setCachedUserEditCount(), WatchedItemStore\setNotificationTimestampsForUser(), MediaWiki\Storage\PageEditStash\storeStashValue(), and MediaWiki\User\DefaultOptionsLookup\verifyUsable().


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