Page MenuHomeClusterLabs Projects
Diviner Tech Docs PhabricatorUser

final class PhabricatorUser
Phorge Technical Documentation (People)

This class is not documented.

Tasks

Managing Connections

  • protected function getConnectionNamespace() — Return a namespace for this object's connections in the connection cache. Generally, the database name is appropriate. Two connections are considered equivalent if they have the same connection namespace and mode.
  • protected function getEstablishedConnection($mode) — Get an existing, cached connection for this object.
  • protected function setEstablishedConnection($mode, $connection, $force_unique) — Store a connection in the connection cache.
  • public function setForcedConnection($connection) — Force an object to use a specific connection.

Configuring Storage

Loading Objects

  • public function load($id) — Load an object by ID. You need to invoke this as an instance method, not a class method, because PHP doesn't have late static binding (until PHP 5.3.0). For example:
  • public function loadAll() — Loads all of the objects, unconditionally.
  • public function loadAllWhere($pattern, ...) — Load all objects which match a WHERE clause. You provide everything after the 'WHERE'; Lisk handles everything up to it. For example:
  • public function loadOneWhere($pattern, ...) — Load a single object identified by a 'WHERE' clause. You provide everything after the 'WHERE', and Lisk builds the first half of the query. See loadAllWhere(). This method is similar, but returns a single result instead of a list.
  • public function reload() — Reload an object from the database, discarding any changes to persistent properties. This is primarily useful after entering a transaction but before applying changes to an object.
  • public function loadFromArray($row) — Initialize this object's properties from a dictionary. Generally, you load single objects with loadOneWhere(), but sometimes it may be more convenient to pull data from elsewhere directly (e.g., a complicated join via @{method:queryData}) and then load from an array representation.
  • public function loadAllFromArray($rows) — Initialize a list of objects from a list of dictionaries. Usually you load lists of objects with @{method:loadAllWhere}, but sometimes that isn't flexible enough. One case is if you need to do joins to select the right objects:

Examining Objects

  • public function getID() — Retrieve the unique ID identifying this object. This value will be null if the object hasn't been persisted and you didn't set it manually.
  • public function hasProperty($property) — Test if a property exists.
  • protected function getAllLiskProperties() — Retrieve a list of all object properties. This list only includes properties that are declared as protected, and it is expected that all properties returned by this function should be persisted to the database. Properties that should not be persisted must be declared as private.
  • protected function checkProperty($property) — Check if a property exists on this object.
  • public function establishConnection($mode, $force_new) — Get or build the database connection for this object.
  • protected function getAllLiskPropertyValues() — Convert this object into a property dictionary. This dictionary can be restored into an object by using @{method:loadFromArray} (unless you're using legacy features with CONFIG_CONVERT_CAMELCASE, but in that case you should just go ahead and die in a fire).

Writing Objects

  • public function setID($id) — Set unique ID identifying this object. You normally don't need to call this method unless with `IDS_MANUAL`.
  • public function save()
  • public function replace() — Save this object, forcing the query to use REPLACE regardless of object state.
  • public function insert() — Save this object, forcing the query to use INSERT regardless of object state.
  • public function update() — Save this object, forcing the query to use UPDATE regardless of object state.
  • public function delete() — Delete this object, permanently.
  • protected function insertRecordIntoDatabase($mode) — Internal implementation of INSERT and REPLACE.

Hooks and Callbacks

  • public function getIDKey() — Retrieve the primary key column, "id" by default. If you can not reasonably name your ID column "id", override this method.
  • public function generatePHID()
  • protected function willWriteData(&$data)
  • protected function didWriteData() — Hook to perform actions after data has been written to the database.
  • protected function willSaveObject() — Hook to make internal object state changes prior to INSERT, REPLACE or UPDATE.
  • protected function willReadData(&$data)
  • protected function didReadData() — Hook to perform an action on data after it is read from the database.
  • protected function willDelete() — Hook to perform an action before the deletion of an object.
  • protected function didDelete() — Hook to perform an action after the deletion of an object.
  • protected function readField($field)
  • protected function writeField($field, $value) — Writes a value to a field. Override this method for custom behavior of setField($value) instead of overriding setField directly.

Utilities

  • protected function applyLiskDataSerialization(&$data, $deserialize) — Applies configured serialization to a dictionary of values.
  • public function __call($method, $args) — Black magic. Builds implied get*() and set*() for all properties.
  • public function __set($name, $value) — Warns against writing to undeclared property.
  • public static function loadNextCounterValue($conn_w, $counter_name) — Increments a named counter and returns the next value.
  • public static function loadCurrentCounterValue($conn_r, $counter_name) — Returns the current value of a named counter.
  • public static function overwriteCounterValue($conn_w, $counter_name, $counter_value) — Overwrite a named counter, forcing it to a specific value.

Managing Transactions

  • public function beginReadLocking() — Begins read-locking selected rows with SELECT ... FOR UPDATE, so that other connections can not read them (this is an enormous oversimplification of FOR UPDATE semantics; consult the MySQL documentation for details). To end read locking, call @{method:endReadLocking}. For example:
  • public function endReadLocking() — Ends read-locking that began at an earlier @{method:beginReadLocking} call.
  • public function beginWriteLocking() — Begins write-locking selected rows with SELECT ... LOCK IN SHARE MODE, so that other connections can not update or delete them (this is an oversimplification of LOCK IN SHARE MODE semantics; consult the MySQL documentation for details). To end write locking, call @{method:endWriteLocking}.
  • public function endWriteLocking() — Ends write-locking that began at an earlier @{method:beginWriteLocking} call.

Isolation for Unit Testing

Availability

Profile Image Cache

No methods for this task.

Multi-Factor Authentication

Managing Handles

No methods for this task.

Settings

User Cache

Other Methods

handle

  • public function loadHandles($phids) — Get a @{class:PhabricatorHandleList} which benefits from this viewer's internal handle pool.
  • public function renderHandle($phid) — Get a @{class:PHUIHandleView} for a single handle.
  • public function renderHandleList($phids) — Get a @{class:PHUIHandleListView} for a list of handles.

Methods

public function __construct()
Inherited

LiskDAO

Build an empty object.

Return
this//Implicit.//

protected function establishLiveConnection($mode)
Inherited

LiskDAO

Establish a live connection to a database service. This method should return a new connection. Lisk handles connection caching and management; do not perform caching deeper in the stack.

Parameters
string$modeMode, either 'r' (reading) or 'w' (reading and writing).
Return
AphrontDatabaseConnectionNew database connection.

protected function getConnectionNamespace()
Inherited

LiskDAO

Return a namespace for this object's connections in the connection cache. Generally, the database name is appropriate. Two connections are considered equivalent if they have the same connection namespace and mode.

Return
stringConnection namespace for cache

protected function getDatabaseName()
Inherited

This method is not documented.
Return
wild

protected function getEstablishedConnection($mode)
Inherited

LiskDAO

Get an existing, cached connection for this object.

Parameters
mode$modeConnection mode.
Return
AphrontDatabaseConnection|nullConnection, if it exists in cache.

protected function setEstablishedConnection($mode, $connection, $force_unique)
Inherited

LiskDAO

Store a connection in the connection cache.

Parameters
mode$modeConnection mode.
AphrontDatabaseConnection$connectionConnection to cache.
$force_unique
Return
this

public function setForcedConnection($connection)
Inherited

LiskDAO

Force an object to use a specific connection.

This overrides all connection management and forces the object to use a specific connection when interacting with the database.

Parameters
AphrontDatabaseConnection$connectionConnection to force this object to use.
Return
wild

protected function getConfiguration()

LiskDAO

Change Lisk behaviors, like ID configuration and timestamps. If you want to change these behaviors, you should override this method in your child class and change the options you're interested in. For example:

protected function getConfiguration() {
  return array(
    Lisk_DataAccessObject::CONFIG_EXAMPLE => true,
  ) + parent::getConfiguration();
}

The available options are:

CONFIG_IDS Lisk objects need to have a unique identifying ID. The three mechanisms available for generating this ID are IDS_AUTOINCREMENT (default, assumes the ID column is an autoincrement primary key), IDS_MANUAL (you are taking full responsibility for ID management), or IDS_COUNTER (see below).

InnoDB does not persist the value of auto_increment across restarts, and instead initializes it to MAX(id) + 1 during startup. This means it may reissue the same autoincrement ID more than once, if the row is deleted and then the database is restarted. To avoid this, you can set an object to use a counter table with IDS_COUNTER. This will generally behave like IDS_AUTOINCREMENT, except that the counter value will persist across restarts and inserts will be slightly slower. If a database stores any DAOs which use this mechanism, you must create a table there with this schema:

CREATE TABLE lisk_counter (
  counterName VARCHAR(64) COLLATE utf8_bin PRIMARY KEY,
  counterValue BIGINT UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CONFIG_TIMESTAMPS Lisk can automatically handle keeping track of a `dateCreated' and `dateModified' column, which it will update when it creates or modifies an object. If you don't want to do this, you may disable this option. By default, this option is ON.

CONFIG_AUX_PHID This option can be enabled by being set to some truthy value. The meaning of this value is defined by your PHID generation mechanism. If this option is enabled, a `phid' property will be populated with a unique PHID when an object is created (or if it is saved and does not currently have one). You need to override generatePHID() and hook it into your PHID generation mechanism for this to work. By default, this option is OFF.

CONFIG_SERIALIZATION You can optionally provide a column serialization map that will be applied to values when they are written to the database. For example:

self::CONFIG_SERIALIZATION => array(
  'complex' => self::SERIALIZATION_JSON,
)

This will cause Lisk to JSON-serialize the 'complex' field before it is written, and unserialize it when it is read.

CONFIG_BINARY You can optionally provide a map of columns to a flag indicating that they store binary data. These columns will not raise an error when handling binary writes.

CONFIG_COLUMN_SCHEMA Provide a map of columns to schema column types.

CONFIG_KEY_SCHEMA Provide a map of key names to key specifications.

CONFIG_NO_TABLE Allows you to specify that this object does not actually have a table in the database.

CONFIG_NO_MUTATE Provide a map of columns which should not be included in UPDATE statements. If you have some columns which are always written to explicitly and should never be overwritten by a save(), you can specify them here. This is an advanced, specialized feature and there are usually better approaches for most locking/contention problems.

PhabricatorUser
This method is not documented.
Return
dictionaryMap of configuration options to values.

public function getConfigOption($option_name)
Inherited

LiskDAO

Determine the setting of a configuration option for this class of objects.

Parameters
const$option_nameOption name, one of the CONFIG_* constants.
Return
mixedOption value, if configured (null if unavailable).

public function load($id)
Inherited

LiskDAO

Load an object by ID. You need to invoke this as an instance method, not a class method, because PHP doesn't have late static binding (until PHP 5.3.0). For example:

$dog = id(new Dog())->load($dog_id);
Parameters
int$idNumeric ID identifying the object to load.
Return
obj|nullIdentified object, or null if it does not exist.

public function loadAll()
Inherited

LiskDAO

Loads all of the objects, unconditionally.

Return
dictDictionary of all persisted objects of this type, keyed on object ID.

public function loadAllWhere($pattern, ...)
Inherited

LiskDAO

Load all objects which match a WHERE clause. You provide everything after the 'WHERE'; Lisk handles everything up to it. For example:

$old_dogs = id(new Dog())->loadAllWhere('age > %d', 7);

The pattern and arguments are as per queryfx().

Parameters
string$patternqueryfx()-style SQL WHERE clause.
...Zero or more conversions.
Return
dictDictionary of matching objects, keyed on ID.

public function loadOneWhere($pattern, ...)
Inherited

LiskDAO

Load a single object identified by a 'WHERE' clause. You provide everything after the 'WHERE', and Lisk builds the first half of the query. See loadAllWhere(). This method is similar, but returns a single result instead of a list.

Parameters
string$patternqueryfx()-style SQL WHERE clause.
...Zero or more conversions.
Return
obj|nullMatching object, or null if no object matches.

protected function loadRawDataWhere($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

public function reload()
Inherited

LiskDAO

Reload an object from the database, discarding any changes to persistent properties. This is primarily useful after entering a transaction but before applying changes to an object.

Return
this

public function loadFromArray($row)
Inherited

LiskDAO

Initialize this object's properties from a dictionary. Generally, you load single objects with loadOneWhere(), but sometimes it may be more convenient to pull data from elsewhere directly (e.g., a complicated join via queryData()) and then load from an array representation.

Parameters
dict$rowDictionary of properties, which should be equivalent to selecting a row from the table or calling @{method:getProperties}.
Return
this

public function loadAllFromArray($rows)
Inherited

LiskDAO

Initialize a list of objects from a list of dictionaries. Usually you load lists of objects with loadAllWhere(), but sometimes that isn't flexible enough. One case is if you need to do joins to select the right objects:

function loadAllWithOwner($owner) {
  $data = $this->queryData(
    'SELECT d.*
      FROM owner o
        JOIN owner_has_dog od ON o.id = od.ownerID
        JOIN dog d ON od.dogID = d.id
      WHERE o.id = %d',
    $owner);
  return $this->loadAllFromArray($data);
}

This is a lot messier than loadAllWhere(), but more flexible.

Parameters
list$rowsList of property dictionaries.
Return
dictList of constructed objects, keyed on ID.

public function setID($id)
Inherited

LiskDAO

Set unique ID identifying this object. You normally don't need to call this method unless with IDS_MANUAL.

Parameters
mixed$idUnique ID.
Return
this

public function getID()
Inherited

LiskDAO

Retrieve the unique ID identifying this object. This value will be null if the object hasn't been persisted and you didn't set it manually.

Return
mixedUnique ID.

public function getPHID()
Inherited

This method is not documented.
Return
wild

public function hasProperty($property)
Inherited

LiskDAO

Test if a property exists.

Parameters
string$propertyProperty name.
Return
boolTrue if the property exists.

protected function getAllLiskProperties()
Inherited

LiskDAO

Retrieve a list of all object properties. This list only includes properties that are declared as protected, and it is expected that all properties returned by this function should be persisted to the database. Properties that should not be persisted must be declared as private.

Return
dictDictionary of normalized (lowercase) to canonical (original case) property names.

protected function checkProperty($property)
Inherited

LiskDAO

Check if a property exists on this object.

Parameters
$property
Return
string|nullCanonical property name, or null if the property does not exist.

public function establishConnection($mode, $force_new)
Inherited

LiskDAO

Get or build the database connection for this object.

Parameters
string$mode'r' for read, 'w' for read/write.
bool$force_newTrue to force a new connection. The connection will not be retrieved from or saved into the connection cache.
Return
AphrontDatabaseConnectionLisk connection object.

protected function getAllLiskPropertyValues()
Inherited

LiskDAO

Convert this object into a property dictionary. This dictionary can be restored into an object by using loadFromArray() (unless you're using legacy features with CONFIG_CONVERT_CAMELCASE, but in that case you should just go ahead and die in a fire).

Return
dictDictionary of object properties.

public function makeEphemeral()
Inherited

LiskDAO

Make an object read-only.

Making an object ephemeral indicates that you will be changing state in such a way that you would never ever want it to be written back to the storage.

Return
wild

private function isEphemeralCheck()
Inherited

This method is not documented.
Return
wild

public function save()

LiskDAO

Persist this object to the database. In most cases, this is the only method you need to call to do writes. If the object has not yet been inserted this will do an insert; if it has, it will do an update.

PhabricatorUser
This method is not documented.
Return
this

public function replace()
Inherited

LiskDAO

Save this object, forcing the query to use REPLACE regardless of object state.

Return
this

public function insert()
Inherited

LiskDAO

Save this object, forcing the query to use INSERT regardless of object state.

Return
this

public function update()
Inherited

LiskDAO

Save this object, forcing the query to use UPDATE regardless of object state.

Return
this

public function delete()
Inherited

LiskDAO

Delete this object, permanently.

Return
this

protected function insertRecordIntoDatabase($mode)
Inherited

LiskDAO

Internal implementation of INSERT and REPLACE.

Parameters
const$modeEither "INSERT" or "REPLACE", to force the desired mode.
Return
this

protected function shouldInsertWhenSaved()
Inherited

LiskDAO

Method used to determine whether to insert or update when saving.

Return
booltrue if the record should be inserted

public function getTableName()
Inherited

LiskDAO

Retrieve the database table name. By default, this is the class name.

Return
stringTable name for object storage.

public function getIDKey()
Inherited

LiskDAO

Retrieve the primary key column, "id" by default. If you can not reasonably name your ID column "id", override this method.

Return
stringName of the ID column.

public function generatePHID()

LiskDAO

Generate a new PHID, used by CONFIG_AUX_PHID.

PhabricatorUser
This method is not documented.
Return
phidUnique, newly allocated PHID.

public function getPHIDType()
Inherited

This method is not documented.
Return
wild

protected function willWriteData(&$data)
Inherited

LiskDAO

Hook to apply serialization or validation to data before it is written to the database. See also willReadData().

Parameters
array&$data
Return
wild

protected function didWriteData()
Inherited

LiskDAO

Hook to perform actions after data has been written to the database.

Return
wild

protected function willSaveObject()
Inherited

LiskDAO

Hook to make internal object state changes prior to INSERT, REPLACE or UPDATE.

Return
wild

protected function willReadData(&$data)
Inherited

LiskDAO

Hook to apply serialization or validation to data as it is read from the database. See also willWriteData().

Parameters
array&$data
Return
wild

protected function didReadData()
Inherited

LiskDAO

Hook to perform an action on data after it is read from the database.

Return
wild

protected function willDelete()
Inherited

LiskDAO

Hook to perform an action before the deletion of an object.

Return
wild

protected function didDelete()
Inherited

LiskDAO

Hook to perform an action after the deletion of an object.

Return
wild

protected function readField($field)

LiskDAO

Reads the value from a field. Override this method for custom behavior of getField() instead of overriding getField directly.

PhabricatorUser
This method is not documented.
Parameters
string$fieldCanonical field name
Return
mixedValue of the field

protected function writeField($field, $value)
Inherited

LiskDAO

Writes a value to a field. Override this method for custom behavior of setField($value) instead of overriding setField directly.

Parameters
string$fieldCanonical field name
mixed$valueValue to write
Return
wild

public function openTransaction()
Inherited

LiskDAO

Increase transaction stack depth.

Return
this

public function saveTransaction()
Inherited

LiskDAO

Decrease transaction stack depth, saving work.

Return
this

public function killTransaction()
Inherited

LiskDAO

Decrease transaction stack depth, discarding work.

Return
this

public function beginReadLocking()
Inherited

LiskDAO

Begins read-locking selected rows with SELECT ... FOR UPDATE, so that other connections can not read them (this is an enormous oversimplification of FOR UPDATE semantics; consult the MySQL documentation for details). To end read locking, call endReadLocking(). For example:

$beach->openTransaction();
  $beach->beginReadLocking();

    $beach->reload();
    $beach->setGrainsOfSand($beach->getGrainsOfSand() + 1);
    $beach->save();

  $beach->endReadLocking();
$beach->saveTransaction();
Return
this

public function endReadLocking()
Inherited

LiskDAO

Ends read-locking that began at an earlier beginReadLocking() call.

Return
this

public function beginWriteLocking()
Inherited

LiskDAO

Begins write-locking selected rows with SELECT ... LOCK IN SHARE MODE, so that other connections can not update or delete them (this is an oversimplification of LOCK IN SHARE MODE semantics; consult the MySQL documentation for details). To end write locking, call endWriteLocking().

Return
this

public function endWriteLocking()
Inherited

LiskDAO

Ends write-locking that began at an earlier beginWriteLocking() call.

Return
this

public static function beginIsolateAllLiskEffectsToCurrentProcess()
Inherited

This method is not documented.
Return
wild

public static function endIsolateAllLiskEffectsToCurrentProcess()
Inherited

This method is not documented.
Return
wild

public static function shouldIsolateAllLiskEffectsToCurrentProcess()
Inherited

This method is not documented.
Return
wild

private function establishIsolatedConnection($mode)
Inherited

This method is not documented.
Parameters
$mode
Return
wild

public static function beginIsolateAllLiskEffectsToTransactions()
Inherited

This method is not documented.
Return
wild

public static function endIsolateAllLiskEffectsToTransactions()
Inherited

This method is not documented.
Return
wild

public static function shouldIsolateAllLiskEffectsToTransactions()
Inherited

This method is not documented.
Return
wild

public static function closeInactiveConnections($idle_window)
Inherited

LiskDAO

Close any connections with no recent activity.

Long-running processes can use this method to clean up connections which have not been used recently.

Parameters
int$idle_windowClose connections with no activity for this many seconds.
Return
void

public static function closeAllConnections()
Inherited

This method is not documented.
Return
wild

public static function closeIdleConnections()
Inherited

This method is not documented.
Return
wild

private static function closeConnection($key)
Inherited

This method is not documented.
Parameters
$key
Return
wild

protected function applyLiskDataSerialization(&$data, $deserialize)
Inherited

LiskDAO

Applies configured serialization to a dictionary of values.

Parameters
array&$data
$deserialize
Return
wild

public function __call($method, $args)
Inherited

LiskDAO

Black magic. Builds implied get*() and set*() for all properties.

Parameters
string$methodMethod name.
list$argsArgument vector.
Return
mixedget*() methods return the property value. set*() methods return $this.

public function __set($name, $value)
Inherited

LiskDAO

Warns against writing to undeclared property.

Parameters
$name
$value
Return
wild

public static function loadNextCounterValue($conn_w, $counter_name)
Inherited

LiskDAO

Increments a named counter and returns the next value.

Parameters
AphrontDatabaseConnection$conn_wDatabase where the counter resides.
string$counter_nameCounter name to create or increment.
Return
intNext counter value.

public static function loadCurrentCounterValue($conn_r, $counter_name)
Inherited

LiskDAO

Returns the current value of a named counter.

Parameters
AphrontDatabaseConnection$conn_rDatabase where the counter resides.
string$counter_nameCounter name to read.
Return
int|nullCurrent value, or `null` if the counter does not exist.

public static function overwriteCounterValue($conn_w, $counter_name, $counter_value)
Inherited

LiskDAO

Overwrite a named counter, forcing it to a specific value.

If the counter does not exist, it is created.

Parameters
AphrontDatabaseConnection$conn_wDatabase where the counter resides.
string$counter_nameCounter name to create or overwrite.
$counter_value
Return
void

private function getBinaryColumns()
Inherited

This method is not documented.
Return
wild

public function getSchemaColumns()
Inherited

This method is not documented.
Return
wild

public function getSchemaKeys()
Inherited

This method is not documented.
Return
wild

public function getColumnMaximumByteLength($column)
Inherited

This method is not documented.
Parameters
$column
Return
wild

public function getSchemaPersistence()
Inherited

This method is not documented.
Return
wild

public function getAphrontRefDatabaseName()
Inherited

This method is not documented.
Return
wild

public function getAphrontRefTableName()
Inherited

This method is not documented.
Return
wild

private function getLiskMetadata($key, $default)
Inherited

This method is not documented.
Parameters
$key
$default
Return
wild

private function setLiskMetadata($key, $value)
Inherited

This method is not documented.
Parameters
$key
$value
Return
wild

public static function pushStorageNamespace($namespace)
Inherited

This method is not documented.
Parameters
$namespace
Return
wild

public static function popStorageNamespace()
Inherited

This method is not documented.
Return
wild

public static function getDefaultStorageNamespace()
Inherited

This method is not documented.
Return
wild

public static function getStorageNamespace()
Inherited

This method is not documented.
Return
wild

public function setForcedStorageNamespace($namespace)
Inherited

This method is not documented.
Parameters
$namespace
Return
wild

private function newClusterConnection($application, $database, $mode)
Inherited

This method is not documented.
Parameters
$application
$database
$mode
Return
wild

private function raiseImproperWrite($database)
Inherited

This method is not documented.
Parameters
$database
Return
wild

private function raiseImpossibleWrite($database)
Inherited

This method is not documented.
Parameters
$database
Return
wild

private function raiseUnconfigured($database)
Inherited

This method is not documented.
Parameters
$database
Return
wild

private function raiseUnreachable($database, $proxy)
Inherited

This method is not documented.
Parameters
$database
Exception$proxy
Return
wild

public function getApplicationName()
Inherited

This method is not documented.
Return
wild

public static function chunkSQL($fragments, $limit)
Inherited

PhabricatorLiskDAO

Break a list of escaped SQL statement fragments (e.g., VALUES lists for INSERT, previously built with qsprintf()) into chunks which will fit under the MySQL 'max_allowed_packet' limit.

If a statement is too large to fit within the limit, it is broken into its own chunk (but might fail when the query executes).

Parameters
array$fragments
$limit
Return
wild

protected function assertAttached($property)
Inherited

This method is not documented.
Parameters
$property
Return
wild

protected function assertAttachedKey($value, $key)
Inherited

This method is not documented.
Parameters
$value
$key
Return
wild

protected function detectEncodingForStorage($string)
Inherited

This method is not documented.
Parameters
$string
Return
wild

protected function getUTF8StringFromStorage($string, $encoding)
Inherited

This method is not documented.
Parameters
$string
$encoding
Return
wild

public function isUserActivated()

Is this a live account which has passed required approvals? Returns true if this is an enabled, verified (if required), approved (if required) account, and false otherwise.

Return
boolTrue if this is a standard, usable account.

public function isResponsive()

Is this a user who we can reasonably expect to respond to requests?

This is used to provide a grey "disabled/unresponsive" dot cue when rendering handles and tags, so it isn't a surprise if you get ignored when you ask things of users who will not receive notifications or could not respond to them (because they are disabled, unapproved, do not have verified email addresses, etc).

Return
boolTrue if this user can receive and respond to requests from other humans.

public function canEstablishWebSessions()

This method is not documented.
Return
wild

public function canEstablishAPISessions()

This method is not documented.
Return
wild

public function canEstablishSSHSessions()

This method is not documented.
Return
wild

public function getIsStandardUser()

Returns true if this is a standard user who is logged in. Returns false for logged out, anonymous, or external users.

Return
bool`true` if the user is a standard user who is logged in with a normal session.

public function getMonogram()

This method is not documented.
Return
wild

public function isLoggedIn()

This method is not documented.
Return
wild

public function saveWithoutIndex()

This method is not documented.
Return
wild

public function attachSession($session)

This method is not documented.
Parameters
PhabricatorAuthSession$session
Return
wild

public function getSession()

This method is not documented.
Return
wild

public function hasSession()

This method is not documented.
Return
wild

public function hasHighSecuritySession()

This method is not documented.
Return
wild

private function generateConduitCertificate()

This method is not documented.
Return
wild

private function cleanUpProfile()

This function removes the blurb from a profile. This is an incredibly broad hammer to handle some spam on the upstream, which will be refined later.

Return
void

public function getUserProfile()

This method is not documented.
Return
wild

public function attachUserProfile($profile)

This method is not documented.
Parameters
PhabricatorUserProfile$profile
Return
wild

public function loadUserProfile()

This method is not documented.
Return
wild

public function loadPrimaryEmailAddress()

This method is not documented.
Return
wild

public function loadPrimaryEmail()

This method is not documented.
Return
wild

public function getUserSetting($key)

This method is not documented.
Parameters
$key
Return
wild

public function compareUserSetting($key, $value)

Test if a given setting is set to a particular value.

Parameters
const$keySetting key.
wild$valueValue to compare.
Return
boolTrue if the setting has the specified value.

private function writeUserSettingCache($key, $value)

This method is not documented.
Parameters
$key
$value
Return
wild

public function getTranslation()

This method is not documented.
Return
wild

public function getTimezoneIdentifier()

This method is not documented.
Return
wild

public static function getGlobalSettingsCacheKey()

This method is not documented.
Return
wild

private function loadGlobalSettings()

This method is not documented.
Return
wild

public function overrideTimezoneIdentifier($identifier)

Override the user's timezone identifier.

This is primarily useful for unit tests.

Parameters
string$identifierNew timezone identifier.
Return
this

public function getGender()

This method is not documented.
Return
wild

public function updateNameTokens()

Populate the nametoken table, which used to fetch typeahead results. When a user types "linc", we want to match "Abraham Lincoln" from on-demand typeahead sources. To do this, we need a separate table of name fragments.

Return
wild

public static function describeValidUsername()

This method is not documented.
Return
wild

public static function validateUsername($username)

This method is not documented.
Parameters
$username
Return
wild

public static function getDefaultProfileImageURI()

This method is not documented.
Return
wild

public function getProfileImageURI()

This method is not documented.
Return
wild

public function getUnreadNotificationCount()

This method is not documented.
Return
wild

public function getUnreadMessageCount()

This method is not documented.
Return
wild

public function getRecentBadgeAwards()

This method is not documented.
Return
wild

public function getFullName()

This method is not documented.
Return
wild

public function getTimeZone()

This method is not documented.
Return
wild

public function getTimeZoneOffset()

This method is not documented.
Return
wild

public function getTimeZoneOffsetInHours()

This method is not documented.
Return
wild

public function formatShortDateTime($when, $now)

This method is not documented.
Parameters
$when
$now
Return
wild

public function __toString()

This method is not documented.
Return
wild

public static function loadOneWithEmailAddress($address)

This method is not documented.
Parameters
$address
Return
wild

public function getDefaultSpacePHID()

This method is not documented.
Return
wild

public function hasConduitClusterToken()

This method is not documented.
Return
wild

public function attachConduitClusterToken($token)

This method is not documented.
Parameters
PhabricatorConduitToken$token
Return
wild

public function getConduitClusterToken()

This method is not documented.
Return
wild

public function attachAvailability($availability)

This method is not documented.
Parameters
array$availability
Return
wild

public function getAwayUntil()

Get the timestamp the user is away until, if they are currently away.

Return
int|nullEpoch timestamp, or `null` if the user is not away.

public function getDisplayAvailability()

This method is not documented.
Return
wild

public function getAvailabilityEventPHID()

This method is not documented.
Return
wild

public function getAvailabilityCache()

Get cached availability, if present.

Return
wild|nullCache data, or null if no cache is available.

public function writeAvailabilityCache($availability, $ttl)

Write to the availability cache.

Parameters
wild$availabilityAvailability cache data.
int|null$ttlCache TTL.
Return
this

public function updateMultiFactorEnrollment()

Update the flag storing this user's enrollment in multi-factor auth.

With certain settings, we need to check if a user has MFA on every page, so we cache MFA enrollment on the user object for performance. Calling this method synchronizes the cache by examining enrollment records. After updating the cache, use getIsEnrolledInMultiFactor() to check if the user is enrolled.

This method should be called after any changes are made to a given user's multi-factor configuration.

Return
void

public function getIsEnrolledInMultiFactor()

Check if the user is enrolled in multi-factor authentication.

Enrolled users have one or more multi-factor authentication sources attached to their account. For performance, this value is cached. You can use updateMultiFactorEnrollment() to update the cache.

Return
boolTrue if the user is enrolled.

public function isOmnipotent()

Returns true if this user is omnipotent. Omnipotent users bypass all policy checks.

Return
boolTrue if the user bypasses policy checks.

public static function getOmnipotentUser()

Get an omnipotent user object for use in contexts where there is no acting user, notably daemons.

Return
PhabricatorUserAn omnipotent user.

public function getCacheFragment()

Get a scalar string identifying this user.

This is similar to using the PHID, but distinguishes between omnipotent and public users explicitly. This allows safe construction of cache keys or cache buckets which do not conflate public and omnipotent users.

Return
stringScalar identifier.

public function loadHandles($phids)

Get a PhabricatorHandleList which benefits from this viewer's internal handle pool.

Parameters
list<phid>$phidsList of PHIDs to load.
Return
PhabricatorHandleListHandle list object.

public function renderHandle($phid)

Get a PHUIHandleView for a single handle.

This benefits from the viewer's internal handle pool.

Parameters
phid$phidPHID to render a handle for.
Return
PHUIHandleViewView of the handle.

public function renderHandleList($phids)

Get a PHUIHandleListView for a list of handles.

This benefits from the viewer's internal handle pool.

Parameters
list<phid>$phidsList of PHIDs to render.
Return
PHUIHandleListViewView of the handles.

public function attachBadgePHIDs($phids)

This method is not documented.
Parameters
array$phids
Return
wild

public function getBadgePHIDs()

This method is not documented.
Return
wild

public function getCSRFToken()

This method is not documented.
Return
wild

public function validateCSRFToken($token)

This method is not documented.
Parameters
$token
Return
wild

public function getAlternateCSRFString()

This method is not documented.
Return
wild

public function attachAlternateCSRFString($string)

This method is not documented.
Parameters
$string
Return
wild

private function newCSRFEngine()

This method is not documented.
Return
wild

public function getCapabilities()

This method is not documented.
Return
wild

public function getPolicy($capability)

This method is not documented.
Parameters
$capability
Return
wild

public function hasAutomaticCapability($capability, $viewer)

This method is not documented.
Parameters
$capability
PhabricatorUser$viewer
Return
wild

public function describeAutomaticCapability($capability)

This method is not documented.
Parameters
$capability
Return
wild

public function getCustomFieldSpecificationForRole($role)

This method is not documented.
Parameters
$role
Return
wild

public function getCustomFieldBaseClass()

This method is not documented.
Return
wild

public function getCustomFields()

This method is not documented.
Return
wild

public function attachCustomFields($fields)

This method is not documented.
Parameters
PhabricatorCustomFieldAttachment$fields
Return
wild

public function destroyObjectPermanently($engine)

This method is not documented.
Parameters
PhabricatorDestructionEngine$engine
Return
wild

public function getSSHPublicKeyManagementURI($viewer)

This method is not documented.
Parameters
PhabricatorUser$viewer
Return
wild

public function getSSHKeyDefaultName()

This method is not documented.
Return
wild

public function getSSHKeyNotifyPHIDs()

This method is not documented.
Return
wild
This method is not documented.
Return
wild
This method is not documented.
Return
wild

public function newFulltextEngine()

This method is not documented.
Return
wild

public function newFerretEngine()

This method is not documented.
Return
wild
This method is not documented.
Return
wild

public function getFieldValuesForConduit()

This method is not documented.
Return
wild

public function getConduitSearchAttachments()

This method is not documented.
Return
wild

public function attachRawCacheData($data)

This method is not documented.
Parameters
array$data
Return
wild

public function setAllowInlineCacheGeneration($allow_cache_generation)

This method is not documented.
Parameters
$allow_cache_generation
Return
wild

protected function requireCacheData($key)

This method is not documented.
Parameters
$key
Return
wild

public function clearCacheData($key)

This method is not documented.
Parameters
$key
Return
wild

public function getCSSValue($variable_key)

This method is not documented.
Parameters
$variable_key
Return
wild

public function newPasswordDigest($envelope, $password)

This method is not documented.
Parameters
PhutilOpaqueEnvelope$envelope
PhabricatorAuthPassword$password
Return
wild

public function newPasswordBlocklist($viewer, $engine)

This method is not documented.
Parameters
PhabricatorUser$viewer
PhabricatorAuthPasswordEngine$engine
Return
wild