Differential D14390 Diff 34772 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
| Show First 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | public function setApplicationEmail( | ||||
| $this->applicationEmail = $email; | $this->applicationEmail = $email; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getApplicationEmail() { | public function getApplicationEmail() { | ||||
| return $this->applicationEmail; | return $this->applicationEmail; | ||||
| } | } | ||||
| public function getTransactionTypesForObject($object) { | |||||
| $old = $this->object; | |||||
| try { | |||||
| $this->object = $object; | |||||
| $result = $this->getTransactionTypes(); | |||||
| $this->object = $old; | |||||
| } catch (Exception $ex) { | |||||
| $this->object = $old; | |||||
| throw $ex; | |||||
| } | |||||
| return $result; | |||||
| } | |||||
| public function getTransactionTypes() { | public function getTransactionTypes() { | ||||
| $types = array(); | $types = array(); | ||||
| if ($this->object instanceof PhabricatorSubscribableInterface) { | if ($this->object instanceof PhabricatorSubscribableInterface) { | ||||
| $types[] = PhabricatorTransactions::TYPE_SUBSCRIBERS; | $types[] = PhabricatorTransactions::TYPE_SUBSCRIBERS; | ||||
| } | } | ||||
| if ($this->object instanceof PhabricatorCustomFieldInterface) { | if ($this->object instanceof PhabricatorCustomFieldInterface) { | ||||
| ▲ Show 20 Lines • Show All 1,392 Lines • ▼ Show 20 Lines | if ($new_set !== null) { | ||||
| $new_set = array_fuse($new_set); | $new_set = array_fuse($new_set); | ||||
| } | } | ||||
| unset($new['=']); | unset($new['=']); | ||||
| if ($new) { | if ($new) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| "Invalid '%s' value for PHID transaction. Value should contain only ". | "Invalid '%s' value for PHID transaction. Value should contain only ". | ||||
| "keys '%s' (add PHIDs), '%' (remove PHIDs) and '%s' (set PHIDS).", | "keys '%s' (add PHIDs), '%s' (remove PHIDs) and '%s' (set PHIDS).", | ||||
| 'new', | 'new', | ||||
| '+', | '+', | ||||
| '-', | '-', | ||||
| '=')); | '=')); | ||||
| } | } | ||||
| $result = array(); | $result = array(); | ||||
| ▲ Show 20 Lines • Show All 1,605 Lines • Show Last 20 Lines | |||||