final public function setActor($actor)Inherited
PhabricatorUser | $actor |
wild |
final public function getActor()Inherited
wild |
final public function requireActor()Inherited
wild |
final public function setExcludeMailRecipientPHIDs($phids)Inherited
$phids |
wild |
final protected function getExcludeMailRecipientPHIDs()Inherited
wild |
abstract public function getEditorApplicationClass()
Get the class name for the application this editor is a part of.
Uninstalling the application will disable the editor.
string | Editor's application class name. |
abstract public function getEditorObjectsDescription()
Get a description of the objects this editor edits, like "Differential Revisions".
string | Human readable description of edited objects. |
public function setActingAsPHID($acting_as_phid)
$acting_as_phid |
wild |
public function getActingAsPHID()
wild |
public function setContinueOnNoEffect($continue)
When the editor tries to apply transactions that have no effect, should it raise an exception (default) or drop them and continue?
Generally, you will set this flag for edits coming from "Edit" interfaces, and leave it cleared for edits coming from "Comment" interfaces, so the user will get a useful error if they try to submit a comment that does nothing (e.g., empty comment with a status change that has already been performed by another user).
bool | $continue | True to drop transactions without effect and continue. |
this |
public function getContinueOnNoEffect()
wild |
public function setContinueOnMissingFields($continue_on_missing_fields)
When the editor tries to apply transactions which don't populate all of an object's required fields, should it raise an exception (default) or drop them and continue?
For example, if a user adds a new required custom field (like "Severity") to a task, all existing tasks won't have it populated. When users manually edit existing tasks, it's usually desirable to have them provide a severity. However, other operations (like batch editing just the owner of a task) will fail by default.
By setting this flag for edit operations which apply to specific fields (like the priority, batch, and merge editors in Maniphest), these operations can continue to function even if an object is outdated.
bool | $continue_on_missing_fields | True to continue when transactions don't completely satisfy all required fields. |
this |
public function getContinueOnMissingFields()
wild |
public function setParentMessageID($parent_message_id)
Not strictly necessary, but reply handlers ideally set this value to make email threading work better.
$parent_message_id |
wild |
public function getParentMessageID()
wild |
public function getIsNewObject()
wild |
public function getMentionedPHIDs()
wild |
public function setIsPreview($is_preview)
$is_preview |
wild |
public function getIsPreview()
wild |
public function setIsSilent($silent)
$silent |
wild |
public function getIsSilent()
wild |
public function getMustEncrypt()
wild |
public function getHeraldRuleMonograms()
wild |
public function setIsInverseEdgeEditor($is_inverse_edge_editor)
$is_inverse_edge_editor |
wild |
public function getIsInverseEdgeEditor()
wild |
public function setIsHeraldEditor($is_herald_editor)
$is_herald_editor |
wild |
public function getIsHeraldEditor()
wild |
public function addUnmentionablePHIDs($phids)
array | $phids |
wild |
private function getUnmentionablePHIDMap()
wild |
protected function shouldEnableMentions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
public function setApplicationEmail($email)
PhabricatorMetaMTAApplicationEmail |
wild |
public function getApplicationEmail()
wild |
public function setRaiseWarnings($raise_warnings)
$raise_warnings |
wild |
public function getRaiseWarnings()
wild |
public function setShouldRequireMFA($should_require_mfa)
$should_require_mfa |
wild |
public function getShouldRequireMFA()
wild |
public function getTransactionTypesForObject($object)
$object |
wild |
public function getTransactionTypes()
wild |
private function adjustTransactionValues($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
private function getTransactionOldValue($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
private function getTransactionNewValue($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function getCustomTransactionOldValue($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function getCustomTransactionNewValue($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function transactionHasEffect($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function shouldApplyInitialEffects($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function applyInitialEffects($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function applyInternalEffects($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
private function applyExternalEffects($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function applyCustomInternalTransaction($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function applyCustomExternalTransaction($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function applyBuiltinInternalTransaction($object, $xaction)
PhabricatorTransactions provides many built-in transactions which should not require much - if any - code in specific applications.
This method is a hook for the exceedingly-rare cases where you may need to do additional work for built-in transactions. Developers should extend this method, making sure to return the parent implementation regardless of handling any transactions.
See also applyBuiltinExternalTransaction().
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function applyBuiltinExternalTransaction($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function populateTransaction($object, $xaction)
Fill in a transaction's common values, like author and content source.
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function didApplyInternalEffects($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function applyFinalEffects($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
final protected function didCommitTransactions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
public function setContentSource($content_source)
PhabricatorContentSource | $content_source |
wild |
public function setContentSourceFromRequest($request)
AphrontRequest | $request |
wild |
public function getContentSource()
wild |
public function setRequest($request)
AphrontRequest | $request |
wild |
public function getRequest()
wild |
public function setCancelURI($cancel_uri)
$cancel_uri |
wild |
public function getCancelURI()
wild |
protected function getTransactionGroupID()
wild |
final public function applyTransactions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
final private function queuePublishing()
wild |
protected function didCatchDuplicateKeyException($object, $xactions, $ex)
PhabricatorLiskDAO | $object | |
array | $xactions | |
Exception | $ex |
wild |
public function publishTransactions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function didApplyTransactions($object, $xactions)
$object | ||
array | $xactions |
wild |
private function loadHandles($xactions)
array | $xactions |
wild |
private function loadSubscribers($object)
PhabricatorLiskDAO | $object |
wild |
private function validateEditParameters($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function applyCapabilityChecks($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function getLegacyRequiredCapabilities($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function getLegacyRequiredEdgeCapabilities($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function buildSubscribeTransaction($object, $xactions, $changes)
PhabricatorLiskDAO | $object | |
array | $xactions | |
array | $changes |
wild |
protected function mergeTransactions($u, $v)
PhabricatorApplicationTransaction | $u | |
PhabricatorApplicationTransaction | $v |
wild |
protected function expandTransactions($object, $xactions)
Optionally expand transactions which imply other effects. For example, resigning from a revision in Differential implies removing yourself as a reviewer.
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function expandTransaction($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
public function getExpandedSupportTransactions($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
private function expandSupportTransactions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function getRemarkupChanges($xactions)
array | $xactions |
wild |
private function getRemarkupChangesFromTransaction($transaction)
PhabricatorApplicationTransaction | $transaction |
wild |
private function expandRemarkupBlockTransactions($object, $xactions, $changes, $engine)
PhabricatorLiskDAO | $object | |
array | $xactions | |
array | $changes | |
PhutilMarkupEngine | $engine |
wild |
protected function expandCustomRemarkupBlockTransactions($object, $xactions, $changes, $engine)
PhabricatorLiskDAO | $object | |
array | $xactions | |
array | $changes | |
PhutilMarkupEngine | $engine |
wild |
private function combineTransactions($xactions)
Attempt to combine similar transactions into a smaller number of total transactions. For example, two transactions which edit the title of an object can be merged into a single edit.
array | $xactions |
wild |
public function mergePHIDOrEdgeTransactions($u, $v)
PhabricatorApplicationTransaction | $u | |
PhabricatorApplicationTransaction | $v |
wild |
protected function mergeEdgeData($type, $u, $v)
$type | ||
array | $u | |
array | $v |
wild |
protected function getPHIDTransactionNewValue($xaction, $old)
PhabricatorApplicationTransaction | $xaction | |
$old |
wild |
public function getPHIDList($old, $new)
array | $old | |
array | $new |
wild |
protected function getEdgeTransactionNewValue($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function checkEdgeList($list, $edge_type)
$list | ||
$edge_type |
wild |
private function normalizeEdgeTransactionValue($xaction, $edge, $dst_phid)
PhabricatorApplicationTransaction | $xaction | |
$edge | ||
$dst_phid |
wild |
protected function sortTransactions($xactions)
array | $xactions |
wild |
protected function filterTransactions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function validateTransaction($object, $type, $xactions)
Hook for validating transactions. This callback will be invoked for each available transaction type, even if an edit does not apply any transactions of that type. This allows you to raise exceptions when required fields are missing, by detecting that the object has no field value and there is no transaction which sets one.
PhabricatorLiskDAO | $object | Object being edited. |
string | $type | Transaction type to validate. |
list<PhabricatorApplicationTransaction> | $xactions | Transactions of given type, which may be empty if the edit does not apply any transactions of the given type. |
list<PhabricatorApplicationTransactionValidationError> | List of validation errors. |
public function validatePolicyTransaction($object, $xactions, $transaction_type, $capability)
PhabricatorLiskDAO | $object | |
array | $xactions | |
$transaction_type | ||
$capability |
wild |
private function validateSpaceTransactions($object, $xactions, $transaction_type)
PhabricatorLiskDAO | $object | |
array | $xactions | |
$transaction_type |
wild |
private function validateSubtypeTransactions($object, $xactions, $transaction_type)
PhabricatorLiskDAO | $object | |
array | $xactions | |
$transaction_type |
wild |
private function validateMFATransactions($object, $xactions, $transaction_type)
PhabricatorLiskDAO | $object | |
array | $xactions | |
$transaction_type |
wild |
protected function adjustObjectForPolicyChecks($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function validateAllTransactions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function validateIsEmptyTextField($field_value, $xactions)
Check for a missing text field.
A text field is missing if the object has no value and there are no transactions which set a value, or if the transactions remove the value. This method is intended to make implementing validateTransaction() more convenient:
$missing = $this->validateIsEmptyTextField( $object->getName(), $xactions);
This will return true if the net effect of the object and transactions is an empty field.
wild | $field_value | Current field value. |
list<PhabricatorApplicationTransaction> | $xactions | Transactions editing the field. |
bool | True if the field will be an empty text field after edits. |
final public function applyImplicitCC($object, $xactions)
When a user interacts with an object, we might want to add them to CC.
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function shouldImplyCC($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
protected function shouldSendMail($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function buildMail($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function buildMailWithRecipients($object, $xactions, $email_to, $email_cc, $unexpandable)
PhabricatorLiskDAO | $object | |
array | $xactions | |
array | $email_to | |
array | $email_cc | |
array | $unexpandable |
wild |
protected function getTransactionsForMail($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function buildMailForTarget($object, $xactions, $target)
PhabricatorLiskDAO | $object | |
array | $xactions | |
PhabricatorMailTarget | $target |
wild |
private function addMailProjectMetadata($object, $template)
PhabricatorLiskDAO | $object | |
PhabricatorMetaMTAMail | $template |
wild |
protected function getMailThreadID($object)
PhabricatorLiskDAO | $object |
wild |
protected function getStrongestAction($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function buildReplyHandler($object)
PhabricatorLiskDAO | $object |
wild |
protected function getMailSubjectPrefix()
wild |
protected function getMailTags($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
public function getMailTagsMap()
wild |
protected function getMailAction($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function buildMailTemplate($object)
PhabricatorLiskDAO | $object |
wild |
protected function getMailTo($object)
PhabricatorLiskDAO | $object |
wild |
protected function newMailUnexpandablePHIDs($object)
PhabricatorLiskDAO | $object |
wild |
protected function getMailCC($object)
PhabricatorLiskDAO | $object |
wild |
protected function buildMailBody($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function getObjectLinkButtonLabelForMail($object)
PhabricatorLiskDAO | $object |
wild |
protected function getObjectLinkButtonURIForMail($object)
PhabricatorLiskDAO | $object |
wild |
protected function addEmailPreferenceSectionToMailBody($body, $object, $xactions)
PhabricatorMetaMTAMailBody | $body | |
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function addHeadersAndCommentsToMailBody($body, $xactions, $object_label, $object_uri)
PhabricatorMetaMTAMailBody | $body | |
array | $xactions | |
$object_label | ||
$object_uri |
wild |
private function getMailDiffSectionHeader($xaction)
$xaction |
wild |
protected function addCustomFieldsToMailBody($body, $object, $xactions)
PhabricatorMetaMTAMailBody | $body | |
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function runHeraldMailRules($messages)
array | $messages |
wild |
protected function shouldPublishFeedStory($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function getFeedStoryType()
wild |
protected function getFeedRelatedPHIDs($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function getFeedNotifyPHIDs($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function getFeedStoryData($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function publishFeedStory($object, $xactions, $mailed_phids)
PhabricatorLiskDAO | $object | |
array | $xactions | |
array | $mailed_phids |
wild |
protected function supportsSearch()
wild |
protected function shouldApplyHeraldRules($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function buildHeraldAdapter($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function setHeraldAdapter($adapter)
HeraldAdapter | $adapter |
wild |
protected function getHeraldAdapter()
wild |
private function setHeraldTranscript($transcript)
HeraldTranscript | $transcript |
wild |
protected function getHeraldTranscript()
wild |
private function applyHeraldRules($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function didApplyHeraldRules($object, $adapter, $transcript)
PhabricatorLiskDAO | $object | |
HeraldAdapter | $adapter | |
HeraldTranscript | $transcript |
wild |
private function getCustomFieldForTransaction($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
private function extractFilePHIDs($object, $xactions)
Extract the PHIDs of any files which these transactions attach.
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
protected function extractFilePHIDsFromCustomTransaction($object, $xaction)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction |
wild |
private function attachFiles($object, $file_phids)
PhabricatorLiskDAO | $object | |
array | $file_phids |
wild |
private function applyInverseEdgeTransactions($object, $xaction, $inverse_type)
PhabricatorLiskDAO | $object | |
PhabricatorApplicationTransaction | $xaction | |
$inverse_type |
wild |
protected function willPublish($object, $xactions)
Load any object state which is required to publish transactions.
This hook is invoked in the main process before we compute data related to publishing transactions (like email "To" and "CC" lists), and again in the worker before publishing occurs.
PhabricatorLiskDAO | $object | |
array | $xactions |
object | Publishable object. |
final private function getWorkerState()
Convert the editor state to a serializable dictionary which can be passed to a worker.
This data will be loaded with loadWorkerState() in the worker.
dict<string, wild> | Serializable editor state. |
protected function getCustomWorkerState()
Hook; return custom properties which need to be passed to workers.
dict<string, wild> | Custom properties. |
protected function getCustomWorkerStateEncoding()
Hook; return storage encoding for custom properties which need to be passed to workers.
This primarily allows binary data to be passed to workers and survive JSON encoding.
dict<string, string> | Property encodings. |
final public function loadWorkerState($state)
Load editor state using a dictionary emitted by getWorkerState().
This method is used to load state when running worker operations.
dict<string, | $state | wild> Editor state, from @{method:getWorkerState}. |
this |
protected function loadCustomWorkerState($state)
Hook; set custom properties on the editor from data emitted by getCustomWorkerState().
dict<string, | $state | wild> Custom state, from @{method:getCustomWorkerState}. |
this |
private function getAutomaticStateProperties()
Get a list of object properties which should be automatically sent to workers in the state data.
These properties will be automatically stored and loaded by the editor in the worker.
list<string> | List of properties. |
final private function encodeStateForStorage($state, $encodings)
Apply encodings prior to storage.
map<string, | $state | wild> Map of values to encode. |
map<string, | $encodings | string> Map of encodings to apply. |
map<string, wild> | Map of encoded values. |
final private function decodeStateFromStorage($state, $encodings)
Undo storage encoding applied when storing state.
map<string, | $state | wild> Map of encoded values. |
map<string, | $encodings | string> Map of encodings. |
map<string, wild> | Map of decoded values. |
private function applyProjectConflictRules($phids)
Remove conflicts from a list of projects.
Objects aren't allowed to be tagged with multiple milestones in the same group, nor projects such that one tag is the ancestor of any other tag. If the list of PHIDs include mutually exclusive projects, remove the conflicting projects.
list<phid> | $phids | List of project PHIDs. |
list<phid> | List with conflicts removed. |
private function scrambleFileSecrets($object)
When the view policy for an object is changed, scramble the secret keys for attached files to invalidate existing URIs.
$object |
wild |
private function shouldScramblePolicy($policy)
Check if a policy is strong enough to justify scrambling. Objects which are set to very open policies don't need to scramble their files, and files with very open policies don't need to be scrambled when associated objects change.
$policy |
wild |
private function updateWorkboardColumns($object, $const, $old, $new)
$object | ||
$const | ||
$old | ||
$new |
wild |
private function getModularTransactionTypes()
wild |
private function getModularTransactionType($type)
$type |
wild |
public function getCreateObjectTitle($author, $object)
$author | ||
$object |
wild |
public function getCreateObjectTitleForFeed($author, $object)
$author | ||
$object |
wild |
protected function queueTransaction($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function flushTransactionQueue($object)
$object |
wild |
final protected function newSubEditor($template)
PhabricatorApplicationTransactionEditor | $template |
wild |
private function newEditorCopy($template)
PhabricatorApplicationTransactionEditor | $template |
wild |
public function newMailStampTemplates($object)
$object |
wild |
final public function getMailStamp($key)
$key |
wild |
private function newMailStamps($object, $xactions)
$object | ||
array | $xactions |
wild |
private function newMailExtensions($object)
$object |
wild |
protected function newAuxiliaryMail($object, $xactions)
$object | ||
array | $xactions |
wild |
private function generateMailStamps($object, $data)
$object | ||
$data |
wild |
public function getRemovedRecipientPHIDs()
wild |
private function buildOldRecipientLists($object, $xactions)
$object | ||
$xactions |
wild |
private function applyOldRecipientLists()
wild |
private function queueWebhooks($object, $xactions)
$object | ||
array | $xactions |
wild |
private function hasWarnings($object, $xaction)
$object | ||
$xaction |
wild |
private function buildHistoryMail($object)
PhabricatorLiskDAO | $object |
wild |
public function newAutomaticInlineTransactions($object, $inlines, $transaction_type, $query_template)
PhabricatorLiskDAO | $object | |
array | $inlines | |
$transaction_type | ||
PhabricatorCursorPagedPolicyAwareQuery | $query_template |
wild |
protected function newInlineStateTransaction($object, $query_template)
PhabricatorLiskDAO | $object | |
PhabricatorCursorPagedPolicyAwareQuery | $query_template |
wild |
private function requireMFA($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function newMFATransactions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function getTitleForTextMail($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function getTitleForHTMLMail($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function getBodyForTextMail($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function isLockOverrideTransaction($xaction)
PhabricatorApplicationTransaction | $xaction |
wild |
private function validateTransactionsWithExtensions($object, $xactions)
PhabricatorLiskDAO | $object | |
array | $xactions |
wild |
private function getEditorExtensions()
wild |
private function newEditorExtensions()
wild |