Page MenuHomeClusterLabs Projects
Diviner Tech Docs PhabricatorMetaMTAMail

final class PhabricatorMetaMTAMail
Phorge Technical Documentation (MetaMTA)

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) — Reads the value from a field. Override this method for custom behavior of @{method:getField} instead of overriding getField directly.
  • 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

Managing Recipients

  • public function buildRecipientList() — Get all of the recipients for this mail, after preference filters are applied. This list has all objects to whom delivery will be attempted.

Other Methods

Methods

public function __construct()

LiskDAO

Build an empty object.

PhabricatorMetaMTAMail
This method is not documented.
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.

PhabricatorMetaMTAMail
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.

PhabricatorMetaMTAMail
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.

PhabricatorMetaMTAMail
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)
Inherited

LiskDAO

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

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

protected function setParam($param, $value)

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

protected function getParam($param, $default)

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

public function setMailTags($tags)

These tags are used to allow users to opt out of receiving certain types of mail, like updates when a task's projects change.

Parameters
list<const>$tags
Return
this

public function getMailTags()

This method is not documented.
Return
wild

public function setParentMessageID($id)

In Gmail, conversations will be broken if you reply to a thread and the server sends back a response without referencing your Message-ID, even if it references a Message-ID earlier in the thread. To avoid this, use the parent email's message ID explicitly if it's available. This overwrites the "In-Reply-To" and "References" headers we would otherwise generate. This needs to be set whenever an action is triggered by an email message. See T251 for more details.

Parameters
string$idThe "Message-ID" of the email which precedes this one.
Return
this

public function getParentMessageID()

This method is not documented.
Return
wild

public function getSubject()

This method is not documented.
Return
wild

public function addTos($phids)

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

public function addRawTos($raw_email)

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

public function addCCs($phids)

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

public function setExcludeMailRecipientPHIDs($exclude)

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

private function getExcludeMailRecipientPHIDs()

This method is not documented.
Return
wild

public function setMutedPHIDs($muted)

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

private function getMutedPHIDs()

This method is not documented.
Return
wild

public function setForceHeraldMailRecipientPHIDs($force)

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

public function addPHIDHeaders($name, $phids)

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

public function addHeader($name, $value)

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

public function getHeaders()

This method is not documented.
Return
wild

public function addAttachment($attachment)

This method is not documented.
Parameters
PhabricatorMailAttachment$attachment
Return
wild

public function getAttachments()

This method is not documented.
Return
wild

public function getAttachmentFilePHIDs()

This method is not documented.
Return
wild

public function loadAttachedFiles($viewer)

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

public function setAttachments($attachments)

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

public function setFrom($from)

This method is not documented.
Parameters
$from
Return
wild

public function getFrom()

This method is not documented.
Return
wild

public function setRawFrom($raw_email, $raw_name)

This method is not documented.
Parameters
$raw_email
$raw_name
Return
wild

public function getRawFrom()

This method is not documented.
Return
wild

public function setReplyTo($reply_to)

This method is not documented.
Parameters
$reply_to
Return
wild

public function getReplyTo()

This method is not documented.
Return
wild

public function setSubject($subject)

This method is not documented.
Parameters
$subject
Return
wild

public function setSubjectPrefix($prefix)

This method is not documented.
Parameters
$prefix
Return
wild

public function getSubjectPrefix()

This method is not documented.
Return
wild

public function setVarySubjectPrefix($prefix)

This method is not documented.
Parameters
$prefix
Return
wild

public function getVarySubjectPrefix()

This method is not documented.
Return
wild

public function setBody($body)

This method is not documented.
Parameters
$body
Return
wild

public function setSensitiveContent($bool)

This method is not documented.
Parameters
$bool
Return
wild

public function hasSensitiveContent()

This method is not documented.
Return
wild

public function setMustEncrypt($bool)

This method is not documented.
Parameters
$bool
Return
wild

public function getMustEncrypt()

This method is not documented.
Return
wild

public function setMustEncryptURI($uri)

This method is not documented.
Parameters
$uri
Return
wild

public function getMustEncryptURI()

This method is not documented.
Return
wild

public function setMustEncryptSubject($subject)

This method is not documented.
Parameters
$subject
Return
wild

public function getMustEncryptSubject()

This method is not documented.
Return
wild

public function setMustEncryptReasons($reasons)

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

public function getMustEncryptReasons()

This method is not documented.
Return
wild

public function setMailStamps($stamps)

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

public function getMailStamps()

This method is not documented.
Return
wild

public function setMailStampMetadata($metadata)

This method is not documented.
Parameters
$metadata
Return
wild

public function getMailStampMetadata()

This method is not documented.
Return
wild

public function getMailerKey()

This method is not documented.
Return
wild

public function setTryMailers($mailers)

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

public function setHTMLBody($html)

This method is not documented.
Parameters
$html
Return
wild

public function getBody()

This method is not documented.
Return
wild

public function getHTMLBody()

This method is not documented.
Return
wild

public function setIsErrorEmail($is_error)

This method is not documented.
Parameters
$is_error
Return
wild

public function getIsErrorEmail()

This method is not documented.
Return
wild

public function getToPHIDs()

This method is not documented.
Return
wild

public function getRawToAddresses()

This method is not documented.
Return
wild

public function getCcPHIDs()

This method is not documented.
Return
wild

public function setMessageType($message_type)

This method is not documented.
Parameters
$message_type
Return
wild

public function getMessageType()

This method is not documented.
Return
wild

public function setForceDelivery($force)

Force delivery of a message, even if recipients have preferences which would otherwise drop the message.

This is primarily intended to let users who don't want any email still receive things like password resets.

Parameters
bool$forceTrue to force delivery despite user preferences.
Return
this

public function getForceDelivery()

This method is not documented.
Return
wild

public function setIsBulk($is_bulk)

Flag that this is an auto-generated bulk message and should have bulk headers added to it if appropriate. Broadly, this means some flavor of "Precedence: bulk" or similar, but is implementation and configuration dependent.

Parameters
bool$is_bulkTrue if the mail is automated bulk mail.
Return
this

public function getIsBulk()

This method is not documented.
Return
wild

public function setThreadID($thread_id, $is_first_message)

Use this method to set an ID used for message threading. MetaMTA will set appropriate headers (Message-ID, In-Reply-To, References and Thread-Index) based on the capabilities of the underlying mailer.

Parameters
string$thread_idUnique identifier, appropriate for use in a Message-ID, In-Reply-To or References headers.
bool$is_first_messageIf true, indicates this is the first message in the thread.
Return
this

public function getThreadID()

This method is not documented.
Return
wild

public function getIsFirstMessage()

This method is not documented.
Return
wild

public function saveAndSend()

Save a newly created mail to the database. The mail will eventually be delivered by the MetaMTA daemon.

Return
this

public function sendNow()

Attempt to deliver an email immediately, in this process.

Return
void

public static function newMailers($constraints)

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

public function sendWithMailers($mailers)

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

public static function shouldMailEachRecipient()

This method is not documented.
Return
wild

public function buildRecipientList()

Get all of the recipients for this mail, after preference filters are applied. This list has all objects to whom delivery will be attempted.

Note that this expands recipients into their members, because delivery is never directly attempted to aggregate actors like projects.

Return
list<phid>A list of all recipients to whom delivery will be attempted.

public function loadAllActors()

This method is not documented.
Return
wild

public function getExpandedRecipientPHIDs()

This method is not documented.
Return
wild

private function getAllActorPHIDs()

This method is not documented.
Return
wild

public function expandRecipients($phids)

Expand a list of recipient PHIDs (possibly including aggregate recipients like projects) into a deaggregated list of individual recipient PHIDs. For example, this will expand project PHIDs into a list of the project's members.

Parameters
list<phid>$phidsList of recipient PHIDs, possibly including aggregate recipients.
Return
list<phid>Deaggregated list of mailable recipients.

private function filterDeliverableActors($actors)

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

private function loadActors($actor_phids)

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

public function getDeliveredHeaders()

This method is not documented.
Return
wild

public function setDeliveredHeaders($headers)

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

public function getUnfilteredHeaders()

This method is not documented.
Return
wild

public function setUnfilteredHeaders($headers)

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

private function flattenHeaders($headers)

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

public function getDeliveredActors()

This method is not documented.
Return
wild

public function getDeliveredRoutingRules()

This method is not documented.
Return
wild

public function getDeliveredRoutingMap()

This method is not documented.
Return
wild

public function getDeliveredBody()

This method is not documented.
Return
wild

public function setDeliveredBody($body)

This method is not documented.
Parameters
$body
Return
wild

public function getURI()

This method is not documented.
Return
wild

public function addRoutingRule($routing_rule, $phids, $reason_phid)

This method is not documented.
Parameters
$routing_rule
$phids
$reason_phid
Return
wild

private function getRoutingRule($phid)

This method is not documented.
Parameters
$phid
Return
wild

private function getRoutingRuleMap()

This method is not documented.
Return
wild

private function loadPreferences($target_phid)

This method is not documented.
Parameters
$target_phid
Return
wild

public function shouldRenderMailStampsInBody($viewer)

This method is not documented.
Parameters
$viewer
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 destroyObjectPermanently($engine)

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