MediaWiki REL1_39
MediaWiki\User\UserEditTracker Class Reference

Track info about user edit counts and timings. More...

Public Member Functions

 __construct (ActorMigration $actorMigration, ILoadBalancer $loadBalancer, JobQueueGroup $jobQueueGroup)
 
 clearUserEditCache (UserIdentity $user)
 
 getFirstEditTimestamp (UserIdentity $user)
 Get the user's first edit timestamp.
 
 getLatestEditTimestamp (UserIdentity $user)
 Get the user's latest edit timestamp.
 
 getUserEditCount (UserIdentity $user)
 Get a user's edit count from the user_editcount field, falling back to initialize.
 
 incrementUserEditCount (UserIdentity $user)
 Schedule a job to increase a user's edit count.
 
 initializeUserEditCount (UserIdentity $user)
 
 setCachedUserEditCount (UserIdentity $user, int $editCount)
 

Detailed Description

Track info about user edit counts and timings.

Since
1.35
Author
DannyS712

Definition at line 21 of file UserEditTracker.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\UserEditTracker::__construct ( ActorMigration $actorMigration,
ILoadBalancer $loadBalancer,
JobQueueGroup $jobQueueGroup )
Parameters
ActorMigration$actorMigration
ILoadBalancer$loadBalancer
JobQueueGroup$jobQueueGroup

Definition at line 48 of file UserEditTracker.php.

Member Function Documentation

◆ clearUserEditCache()

MediaWiki\User\UserEditTracker::clearUserEditCache ( UserIdentity $user)
Access: internal
For use by User::clearInstanceCache()
Parameters
UserIdentity$user

Definition at line 196 of file UserEditTracker.php.

References MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().

◆ getFirstEditTimestamp()

MediaWiki\User\UserEditTracker::getFirstEditTimestamp ( UserIdentity $user)

Get the user's first edit timestamp.

Parameters
UserIdentity$user
Returns
string|false Timestamp of first edit, or false for non-existent/anonymous user accounts.

Definition at line 145 of file UserEditTracker.php.

◆ getLatestEditTimestamp()

MediaWiki\User\UserEditTracker::getLatestEditTimestamp ( UserIdentity $user)

Get the user's latest edit timestamp.

Parameters
UserIdentity$user
Returns
string|false Timestamp of latest edit, or false for non-existent/anonymous user accounts.

Definition at line 156 of file UserEditTracker.php.

◆ getUserEditCount()

MediaWiki\User\UserEditTracker::getUserEditCount ( UserIdentity $user)

Get a user's edit count from the user_editcount field, falling back to initialize.

Parameters
UserIdentity$user
Returns
int|null Null for anonymous users

Definition at line 64 of file UserEditTracker.php.

◆ incrementUserEditCount()

MediaWiki\User\UserEditTracker::incrementUserEditCount ( UserIdentity $user)

Schedule a job to increase a user's edit count.

Since
1.37
Parameters
UserIdentity$user

Definition at line 126 of file UserEditTracker.php.

References MediaWiki\User\UserIdentity\isRegistered().

◆ initializeUserEditCount()

MediaWiki\User\UserEditTracker::initializeUserEditCount ( UserIdentity $user)
Access: internal
For use in UserEditCountUpdate class
Parameters
UserIdentity$user
Returns
int

Definition at line 98 of file UserEditTracker.php.

◆ setCachedUserEditCount()

MediaWiki\User\UserEditTracker::setCachedUserEditCount ( UserIdentity $user,
int $editCount )
Access: internal
For use by User::loadFromRow() and tests
Parameters
UserIdentity$user
int$editCount
Exceptions
InvalidArgumentExceptionIf the user is not registered

Definition at line 213 of file UserEditTracker.php.

References MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().


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