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()Inherited
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()
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)
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()
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()
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)
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)
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)
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)
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()
wild |
public function shouldAppearInEditView()Inherited
wild |
public function shouldAppearInEditEngine()Inherited
wild |
public function readValueFromRequest($request)
AphrontRequest | $request |
wild |
public function getRequiredHandlePHIDsForEdit()Inherited
wild |
public function getInstructionsForEdit()Inherited
wild |
public function renderEditControl($handles)
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()
wild |
public function getConduitEditParameterType()Inherited
wild |
protected function newConduitEditParameterType()
wild |
public function getCommentAction()Inherited
wild |
protected function newCommentAction()Inherited
wild |
public function shouldAppearInHerald()
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()
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()
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 getFieldType()
wild |
public static function buildStandardFields($template, $config, $builtin)Inherited
PhabricatorCustomField | $template | |
array | $config | |
$builtin |
wild |
public function setApplicationField($application_field)Inherited
PhabricatorStandardCustomFieldInterface | $application_field |
wild |
public function getApplicationField()Inherited
wild |
public function setFieldName($name)Inherited
$name |
wild |
public function getFieldValue()Inherited
wild |
public function setFieldValue($value)Inherited
$value |
wild |
public function setCaption($caption)Inherited
$caption |
wild |
public function getCaption()Inherited
wild |
public function setFieldDescription($description)Inherited
$description |
wild |
public function setIsBuiltin($is_builtin)Inherited
$is_builtin |
wild |
public function getIsBuiltin()Inherited
wild |
public function setFieldConfig($config)Inherited
array | $config |
wild |
public function getFieldConfigValue($key, $default)Inherited
$key | ||
$default |
wild |
public function setFieldError($field_error)Inherited
$field_error |
wild |
public function getFieldError()Inherited
wild |
public function setRequired($required)Inherited
$required |
wild |
public function getRequired()Inherited
wild |
public function setRawStandardFieldKey($raw_key)Inherited
$raw_key |
wild |
public function getRawStandardFieldKey()Inherited
wild |
public function setIsEnabled($is_enabled)Inherited
$is_enabled |
wild |
public function getIsEnabled()Inherited
wild |
public function setFieldKey($field_key)Inherited
$field_key |
wild |
public function setStrings($strings)Inherited
array | $strings |
wild |
public function getString($key, $default)Inherited
$key | ||
$default |
wild |
public function setIsCopyable($is_copyable)Inherited
$is_copyable |
wild |
public function getIsCopyable()Inherited
wild |
public function getPlaceholder()Inherited
wild |
protected function isValueEmpty($value)Inherited
$value |
wild |
public function getFieldControlID($key)Inherited
$key |
wild |