Go to the documentation of this file.
53 $this->
id = intval(
$id );
54 $this->newOptions = [];
129 if (
$db && $userdb ) {
130 $row = $userdb->selectRow(
'user',
131 [
'user_id',
'user_name' ],
132 [ $field => $value ],
135 if ( $row !==
false ) {
137 $db,
$dbDomain, $row->user_name, intval( $row->user_id ) );
152 if ( $ignoreInvalidDB || self::validDatabase(
$dbDomain ) ) {
174 return $this->
getId() == 0;
200 return array_keys( self::getGroupMemberships() );
226 return $ugm->insert(
true, $this->db );
240 return $ugm->delete( $this->db );
249 $this->newOptions[$option] = $value;
254 foreach ( $this->newOptions as $option => $value ) {
257 'up_property' => $option,
258 'up_value' => $value,
261 $this->db->replace(
'user_properties',
262 [ [
'up_user',
'up_property' ] ],
274 [
'user_touched' => $this->db->timestamp() ],
279 $domainId = $this->db->getDomainID();
281 $this->db->onTransactionPreCommitOrIdle(
282 function () use ( $domainId, $userId ) {
string[] $wgLocalDatabases
Other wikis on this site, can be administered from a single developer account.
static isCurrentWikiId( $wikiId)
$wgSharedDB
Shared database for multiple wikis.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static newFromId( $dbDomain, $id, $ignoreInvalidDB=false)
Factory function; get a remote user entry by ID number.
static validDatabase( $dbDomain)
Confirm the selected database name is a valid local interwiki database name.
getGroupMemberships()
Replaces User::getGroupMemberships()
Cut-down copy of User interface for local-interwiki-database user rights manipulation.
static getMembershipsForUser( $userId, IDatabase $db=null)
Returns UserGroupMembership objects for all the groups a user currently belongs to.
static newFromLookup( $dbDomain, $field, $value, $ignoreInvalidDB=false)
setOption( $option, $value)
Replaces User::setOption()
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
invalidateCache()
Replaces User::touchUser()
getUserPage()
Same as User::getUserPage()
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
__construct( $db, $dbDomain, $name, $id)
static newFromName( $dbDomain, $name, $ignoreInvalidDB=false)
Factory function; get a remote user entry by name.
removeGroup( $group)
Replaces User::removeGroup()
static whoIs( $dbDomain, $id, $ignoreInvalidDB=false)
Same as User::whoIs()
getName()
Same as User::getName()
static purge( $dbDomain, $userId)
static getDB( $dbDomain, $ignoreInvalidDB=false)
Open a database connection to work on for the requested user.
static getMembership( $userId, $group, IDatabase $db=null)
Returns a UserGroupMembership object that pertains to the given user and group, or false if the user ...
addGroup( $group, $expiry=null)
Replaces User::addGroup()
Represents a "user group membership" – a specific instance of a user belonging to a group.
getGroups()
Replaces User::getUserGroups()