Page MenuHomePhabricator

abstract class PhabricatorPHIDType
Phabricator Technical Documentation (PHIDs)

This class is not documented.

Methods

final public function getTypeConstant()

This method is not documented.
Return
wild

abstract public function getTypeName()

This method is not documented.
Return
wild

public function getTypeIcon()

This method is not documented.
Return
wild

public function newObject()

This method is not documented.
Return
wild

abstract public function getPHIDTypeApplicationClass()

Get the class name for the application this type belongs to.

Return
string|nullClass name of the corresponding application, or null if the type is not bound to an application.

abstract protected function buildQueryForObjects($query, $phids)

Build a PhabricatorPolicyAwareQuery to load objects of this type by PHID.

If you can not build a single query which satisfies this requirement, you can provide a dummy implementation for this method and overload loadObjects() instead.

Parameters
PhabricatorObjectQuery$queryQuery being executed.
list<phid>$phidsPHIDs to load.
Return
PhabricatorPolicyAwareQueryQuery object which loads the specified PHIDs when executed.

public function loadObjects($query, $phids)

Load objects of this type, by PHID. For most PHID types, it is only necessary to implement buildQueryForObjects() to get object loading to work.

Parameters
PhabricatorObjectQuery$queryQuery being executed.
list<phid>$phidsPHIDs to load.
Return
list<wild>Corresponding objects.

abstract public function loadHandles($query, $handles, $objects)

Populate provided handles with application-specific data, like titles and URIs.

NOTE: The $handles and $objects lists are guaranteed to be nonempty and have the same keys: subclasses are expected to load information only for handles with visible objects.

Because of this guarantee, a safe implementation will typically look like*

foreach ($handles as $phid => $handle) {
  $object = $objects[$phid];

  $handle->setStuff($object->getStuff());
  // ...
}

In general, an implementation should call setName() and setURI() on each handle at a minimum. See PhabricatorObjectHandle for other handle properties.

Parameters
PhabricatorHandleQuery$queryIssuing query object.
list<PhabricatorObjectHandle>$handlesHandles to populate with data.
list<Object>$objectsObjects for these PHIDs loaded by @{method:buildQueryForObjects()}.
Return
void

public function canLoadNamedObject($name)

This method is not documented.
Parameters
$name
Return
wild

public function loadNamedObjects($query, $names)

This method is not documented.
Parameters
PhabricatorObjectQuery$query
array$names
Return
wild

final public static function getAllTypes()

Get all known PHID types.

To get PHID types a given user has access to, see getAllInstalledTypes().

Return
dict<string, PhabricatorPHIDType>Map of type constants to types.

final public static function getTypes($types)

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

private static function newClassMapQuery()

This method is not documented.
Return
wild

public static function getAllInstalledTypes($viewer)

Get all PHID types of applications installed for a given viewer.

Parameters
PhabricatorUser$viewerViewing user.
Return
dict<string, PhabricatorPHIDType>Map of constants to installed types.