Page MenuHomePhabricator

D12937.diff
No OneTemporary

D12937.diff

diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -385,12 +385,11 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PhabricatorTransactions::TYPE_BUILDABLE:
- case PhabricatorTransactions::TYPE_TOKEN:
- return;
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
$field = $this->getCustomFieldForTransaction($object, $xaction);
return $field->applyApplicationTransactionInternalEffects($xaction);
+ case PhabricatorTransactions::TYPE_BUILDABLE:
+ case PhabricatorTransactions::TYPE_TOKEN:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
@@ -408,9 +407,6 @@
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PhabricatorTransactions::TYPE_BUILDABLE:
- case PhabricatorTransactions::TYPE_TOKEN:
- return;
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
$subeditor = id(new PhabricatorSubscriptionsEditor())
->setObject($object)
@@ -442,6 +438,8 @@
$field = $this->getCustomFieldForTransaction($object, $xaction);
return $field->applyApplicationTransactionExternalEffects($xaction);
case PhabricatorTransactions::TYPE_EDGE:
+ case PhabricatorTransactions::TYPE_BUILDABLE:
+ case PhabricatorTransactions::TYPE_TOKEN:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
@@ -471,11 +469,17 @@
"implementation!");
}
- // TODO: Write proper documentation for these hooks. These are like the
- // "applyCustom" hooks, except that implementation is optional, so you do
- // not need to handle all of the builtin transaction types. See T6403. These
- // are not completely implemented.
-
+ /**
+ * @{class: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 @{method:applyBuiltinExternalTransaction}.
+ */
protected function applyBuiltinInternalTransaction(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
@@ -493,6 +497,9 @@
}
}
+ /**
+ * See @{method::applyBuiltinInternalTransaction}.
+ */
protected function applyBuiltinExternalTransaction(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 14, 9:30 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7671920
Default Alt Text
D12937.diff (3 KB)

Event Timeline