public static function getObjectFields($object, $role)Inherited
PhabricatorCustomFieldInterface | $object | |
$role |
wild |
public static function getObjectField($object, $role, $field_key)Inherited
PhabricatorCustomFieldInterface | $object | |
$role | ||
$field_key |
wild |
public static function buildFieldList($base_class, $spec, $object, $options)Inherited
$base_class | ||
array | $spec | |
$object | ||
array | $options |
wild |
public function getFieldKey()
Return a key which uniquely identifies this field, like "mycompany:dinosaur:count". Normally you should provide some level of namespacing to prevent collisions.
string | String which uniquely identifies this field. |
public function getModernFieldKey()Inherited
wild |
public function getFieldName()Inherited
Return a human-readable field name.
string | Human readable field name. |
public function getFieldDescription()Inherited
Return a short, human-readable description of the field's behavior. This provides more context to administrators when they are customizing fields.
string|null | Optional human-readable description. |
public function createFields($object)Inherited
Most field implementations are unique, in that one class corresponds to one field. However, some field implementations are general and a single implementation may drive several fields.
For general implementations, the general field implementation can return multiple field instances here.
object | $object | The object to create fields for. |
list<PhabricatorCustomField> | List of fields. |
public function isFieldEnabled()Inherited
You can return false here if the field should not be enabled for any role. For example, it might depend on something (like an application or library) which isn't installed, or might have some global configuration which allows it to be disabled.
bool | False to completely disable this field for all roles. |
public function shouldEnableForRole($role)Inherited
Low level selector for field availability. Fields can appear in different roles (like an edit view, a list view, etc.), but not every field needs to appear everywhere. Fields that are disabled in a role won't appear in that context within applications.
Normally, you do not need to override this method. Instead, override the methods specific to roles you want to enable. For example, implement shouldUseStorage()() to activate the 'storage' role.
$role |
bool | True to enable the field for the given role. |
public function canDisableField()Inherited
Allow administrators to disable this field. Most fields should allow this, but some are fundamental to the behavior of the application and can be locked down to avoid chaos, disorder, and the decline of civilization.
bool | False to prevent this field from being disabled through configuration. |
public function shouldDisableByDefault()Inherited
wild |
final public function getFieldIndex()Inherited
Return an index string which uniquely identifies this field.
string | Index string which uniquely identifies this field. |
public function canSetProxy()Inherited
Proxies allow a field to use some other field's implementation for most of their behavior while still subclassing an application field. When a proxy is set for a field with setProxy(), all of its methods will call through to the proxy by default.
This is most commonly used to implement configuration-driven custom fields using PhabricatorStandardCustomField.
This method must be overridden to return true before a field can accept proxies.
bool | True if you can @{method:setProxy} this field. |
final public function setProxy($proxy)Inherited
Set the proxy implementation for this field. See canSetProxy() for discussion of field proxies.
PhabricatorCustomField | $proxy | Field implementation. |
this |
final public function getProxy()Inherited
Get the field's proxy implementation, if any. For discussion, see canSetProxy().
PhabricatorCustomField|null | Proxy field, if one is set. |
final public function setObject($object)Inherited
Sets the object this field belongs to.
PhabricatorCustomFieldInterface | $object | The object this field belongs to. |
this |
public function readValueFromObject($object)Inherited
Read object data into local field storage, if applicable.
PhabricatorCustomFieldInterface | $object | The object this field belongs to. |
this |
final public function getObject()Inherited
Get the object this field belongs to.
PhabricatorCustomFieldInterface | The object this field belongs to. |
protected function didSetObject($object)Inherited
This is a hook, primarily for subclasses to load object data.
PhabricatorCustomFieldInterface | $object |
PhabricatorCustomFieldInterface | The object this field belongs to. |
final public function setViewer($viewer)Inherited
PhabricatorUser | $viewer |
wild |
final public function getViewer()Inherited
wild |
final protected function requireViewer()Inherited
wild |
protected function renderHandleList($handles)Inherited
array | $handles |
wild |
public function shouldUseStorage()Inherited
Return true to use field storage.
Fields which can be edited by the user will most commonly use storage, while some other types of fields (for instance, those which just display information in some stylized way) may not. Many builtin fields do not use storage because their data is available on the object itself.
If you implement this, you must also implement getValueForStorage() and setValueFromStorage().
bool | True to use storage. |
public function newStorageObject()Inherited
Return a new, empty storage object. This should be a subclass of PhabricatorCustomFieldStorage which is bound to the application's database.
PhabricatorCustomFieldStorage | New empty storage object. |
public function getValueForStorage()Inherited
Return a serialized representation of the field value, appropriate for storing in auxiliary field storage. You must implement this method if you implement shouldUseStorage().
If the field value is a scalar, it can be returned unmodiifed. If not, it should be serialized (for example, using JSON).
string | Serialized field value. |
public function setValueFromStorage($value)Inherited
Set the field's value given a serialized storage value. This is called when the field is loaded; if no data is available, the value will be null. You must implement this method if you implement shouldUseStorage().
Usually, the value can be loaded directly. If it isn't a scalar, you'll need to undo whatever serialization you applied in getValueForStorage().
string|null | $value | Serialized field representation (from @{method:getValueForStorage}) or null if no value has ever been stored. |
this |
public function didSetValueFromStorage()Inherited
wild |
public function shouldAppearInApplicationSearch()Inherited
Appearing in ApplicationSearch allows a field to be indexed and searched for.
bool | True to appear in ApplicationSearch. |
public function buildFieldIndexes()Inherited
Return one or more indexes which this field can meaningfully query against to implement ApplicationSearch.
Normally, you should build these using newStringIndex() and newNumericIndex(). For example, if a field holds a numeric value it might return a single numeric index:
return array($this->newNumericIndex($this->getValue()));
If a field holds a more complex value (like a list of users), it might return several string indexes:
$indexes = array(); foreach ($this->getValue() as $phid) { $indexes[] = $this->newStringIndex($phid); } return $indexes;
list<PhabricatorCustomFieldIndexStorage> | List of indexes. |
public function buildOrderIndex()Inherited
Return an index against which this field can be meaningfully ordered against to implement ApplicationSearch.
This should be a single index, normally built using newStringIndex() and newNumericIndex().
The value of the index is not used.
Return null from this method if the field can not be ordered.
PhabricatorCustomFieldIndexStorage | A single index to order by. |
protected function newStringIndexStorage()Inherited
Build a new empty storage object for storing string indexes. Normally, this should be a concrete subclass of PhabricatorCustomFieldStringIndexStorage.
PhabricatorCustomFieldStringIndexStorage | Storage object. |
protected function newNumericIndexStorage()Inherited
Build a new empty storage object for storing string indexes. Normally, this should be a concrete subclass of PhabricatorCustomFieldStringIndexStorage.
PhabricatorCustomFieldStringIndexStorage | Storage object. |
protected function newStringIndex($value)Inherited
Build and populate storage for a string index.
string | $value | String to index. |
PhabricatorCustomFieldStringIndexStorage | Populated storage. |
protected function newNumericIndex($value)Inherited
Build and populate storage for a numeric index.
string | $value | Numeric value to index. |
PhabricatorCustomFieldNumericIndexStorage | Populated storage. |
public function readApplicationSearchValueFromRequest($engine, $request)Inherited
Read a query value from a request, for storage in a saved query. Normally, this method should, e.g., read a string out of the request.
PhabricatorApplicationSearchEngine | $engine | Engine building the query. |
AphrontRequest | $request | Request to read from. |
wild |
public function applyApplicationSearchConstraintToQuery($engine, $query, $value)Inherited
Constrain a query, given a field value. Generally, this method should use with...() methods to apply filters or other constraints to the query.
PhabricatorApplicationSearchEngine | $engine | Engine executing the query. |
PhabricatorCursorPagedPolicyAwareQuery | $query | Query to constrain. |
wild | $value | Constraint provided by the user. |
void |
public function appendToApplicationSearchForm($engine, $form, $value)Inherited
Append search controls to the interface.
PhabricatorApplicationSearchEngine | $engine | Engine constructing the form. |
AphrontFormView | $form | The form to update. |
wild | $value | Value from the saved query. |
void |
public function shouldAppearInApplicationTransactions()Inherited
Appearing in ApplicationTrasactions allows a field to be edited using standard workflows.
bool | True to appear in ApplicationTransactions. |
public function getApplicationTransactionType()Inherited
wild |
public function getApplicationTransactionMetadata()Inherited
wild |
public function getOldValueForApplicationTransactions()Inherited
wild |
public function getNewValueForApplicationTransactions()Inherited
wild |
public function setValueFromApplicationTransactions($value)Inherited
$value |
wild |
public function getNewValueFromApplicationTransactions($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function getApplicationTransactionHasEffect($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function applyApplicationTransactionInternalEffects($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function getApplicationTransactionRemarkupBlocks($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function applyApplicationTransactionExternalEffects($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function validateApplicationTransactions($editor, $type, $xactions)Inherited
Validate transactions for an object. This allows you to raise an error when a transaction would set a field to an invalid value, or when a field is required but no transactions provide value.
PhabricatorLiskDAO | $editor | Editor applying the transactions. |
string | $type | Transaction type. This type is always `PhabricatorTransactions::TYPE_CUSTOMFIELD`, it is provided for convenience when constructing exceptions. |
list<PhabricatorApplicationTransaction> | $xactions | Transactions being applied, which may be empty if this field is not being edited. |
list<PhabricatorApplicationTransactionValidationError> | Validation errors. |
public function getApplicationTransactionTitle($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function getApplicationTransactionTitleForFeed($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function getApplicationTransactionHasChangeDetails($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function getApplicationTransactionChangeDetails($xaction, $viewer)Inherited
PhabricatorApplicationTransaction | $xaction | |
PhabricatorUser | $viewer |
wild |
public function getApplicationTransactionRequiredHandlePHIDs($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function shouldHideInApplicationTransactions($xaction)Inherited
PhabricatorApplicationTransaction | $xaction |
wild |
public function shouldAppearInTransactionMail()Inherited
wild |
public function updateTransactionMailBody($body, $editor, $xactions)Inherited
PhabricatorMetaMTAMailBody | $body | |
PhabricatorApplicationTransactionEditor | $editor | |
array | $xactions |
wild |
public function getEditEngineFields($engine)Inherited
PhabricatorEditEngine | $engine |
wild |
protected function newEditField()Inherited
wild |
protected function newStandardEditField()Inherited
wild |
protected function getBulkEditLabel()Inherited
wild |
public function getBulkParameterType()Inherited
wild |
protected function newBulkParameterType()Inherited
wild |
protected function getHTTPParameterType()Inherited
wild |
public function shouldAppearInEditView()Inherited
wild |
public function shouldAppearInEditEngine()Inherited
wild |
public function readValueFromRequest($request)Inherited
AphrontRequest | $request |
wild |
public function getRequiredHandlePHIDsForEdit()Inherited
wild |
public function getInstructionsForEdit()Inherited
wild |
public function renderEditControl($handles)Inherited
array | $handles |
wild |
public function shouldAppearInPropertyView()Inherited
wild |
public function renderPropertyViewLabel()Inherited
wild |
public function renderPropertyViewValue($handles)
array | $handles |
wild |
public function getStyleForPropertyView()Inherited
wild |
public function getIconForPropertyView()Inherited
wild |
public function getRequiredHandlePHIDsForPropertyView()Inherited
wild |
public function shouldAppearInListView()Inherited
wild |
public function renderOnListItem($view)Inherited
PHUIObjectItemView | $view |
wild |
public function shouldAppearInGlobalSearch()Inherited
wild |
public function updateAbstractDocument($document)Inherited
PhabricatorSearchAbstractDocument | $document |
wild |
public function shouldAppearInDataExport()Inherited
wild |
public function newExportField()Inherited
wild |
public function newExportData()Inherited
wild |
protected function newExportFieldType()Inherited
wild |
public function shouldAppearInConduitDictionary()Inherited
wild |
public function getConduitDictionaryValue()Inherited
wild |
public function shouldAppearInConduitTransactions()Inherited
wild |
public function getConduitSearchParameterType()Inherited
wild |
protected function newConduitSearchParameterType()Inherited
wild |
public function getConduitEditParameterType()Inherited
wild |
protected function newConduitEditParameterType()Inherited
wild |
public function getCommentAction()Inherited
wild |
protected function newCommentAction()Inherited
wild |
public function shouldAppearInHerald()Inherited
Return true to make this field available in Herald.
bool | True to expose the field in Herald. |
public function getHeraldFieldName()Inherited
Get the name of the field in Herald. By default, this uses the normal field name.
string | Herald field name. |
public function getHeraldFieldValue()Inherited
Get the field value for evaluation by Herald.
wild | Field value. |
public function getHeraldFieldConditions()Inherited
Get the available conditions for this field in Herald.
list<const> | List of Herald condition constants. |
public function getHeraldFieldValueType($condition)Inherited
Get the Herald value type for the given condition.
const | $condition | Herald condition constant. |
const|null | Herald value type, or null to use the default. |
public function getHeraldFieldStandardType()Inherited
wild |
public function getHeraldDatasource()Inherited
wild |
public function shouldAppearInHeraldActions()Inherited
wild |
public function getHeraldActionName()Inherited
wild |
public function getHeraldActionStandardType()Inherited
wild |
public function getHeraldActionDescription($value)Inherited
$value |
wild |
public function getHeraldActionEffectDescription($value)Inherited
$value |
wild |
public function getHeraldActionDatasource()Inherited
wild |
private static function adjustCustomFieldsForObjectSubtype($object, $role, $fields)Inherited
PhabricatorCustomFieldInterface | $object | |
$role | ||
array | $fields |
wild |
public function getName()
wild |
public function getStorageKey()Inherited
wild |
public function getRequiredStorageKey()Inherited
wild |
final public function isEditable()Inherited
wild |
final public function getValue()Inherited
wild |
final public function setValue($value)Inherited
$value |
wild |
public function validate($value)Inherited
$value |
wild |
public function normalizeForTransactionView($xaction, $value)Inherited
Turn values as they are stored in a ReleephRequest into a text that can be rendered as a transactions old/new values.
PhabricatorApplicationTransaction | $xaction | |
$value |
wild |
public function getKeyForConduit()Inherited
wild |
public function getValueForConduit()Inherited
wild |
public function setValueFromConduitAPIRequest($request)Inherited
ConduitAPIRequest | $request |
wild |
public function renderHelpForArcanist()Inherited
wild |
final public function setReleephProject($rp)Inherited
ReleephProject | $rp |
wild |
final public function setReleephBranch($rb)Inherited
ReleephBranch | $rb |
wild |
final public function setReleephRequest($rr)Inherited
ReleephRequest | $rr |
wild |
final public function setUser($user)Inherited
PhabricatorUser | $user |
wild |
final public function getReleephProject()Inherited
wild |
final public function getReleephBranch()Inherited
wild |
final public function getReleephRequest()Inherited
wild |
final public function getUser()Inherited
wild |
public function shouldAppearOnCommitMessage()Inherited
wild |
public function renderLabelForCommitMessage()Inherited
wild |
public function renderValueForCommitMessage()Inherited
wild |
public function shouldAppearOnRevertMessage()Inherited
wild |
public function renderLabelForRevertMessage()Inherited
wild |
public function renderValueForRevertMessage()Inherited
wild |
public function shouldMarkup()Inherited
ReleephFieldSpecification implements much of PhabricatorMarkupInterface for you. If you return true from shouldMarkup(), and implement getMarkupText() then your text will be rendered through the Phabricator markup pipeline.
Output is retrievable with getMarkupEngineOutput().
wild |
public function getMarkupText($field)Inherited
$field |
wild |
final public function getMarkupEngineOutput()Inherited
wild |
final public function setMarkupEngine($engine)Inherited
PhabricatorMarkupEngine | $engine |
wild |
final public function getMarkupFieldKey($field)Inherited
$field |
wild |
final public function newMarkupEngine($field)Inherited
$field |
wild |
final public function didMarkupText($field, $output, $engine)Inherited
$field | ||
$output | ||
PhutilMarkupEngine | $engine |
wild |
final public function shouldUseMarkupCache($field)Inherited
$field |
wild |
private function countLinesAndPaths($changesets)
array | $changesets |
wild |