Differential D17083 Diff 41099 src/applications/transactions/storage/PhabricatorModularTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorModularTransaction.php
| Show All 40 Lines | abstract class PhabricatorModularTransaction | ||||
| } | } | ||||
| private function newTransactionImplementation() { | private function newTransactionImplementation() { | ||||
| $types = $this->newModularTransactionTypes(); | $types = $this->newModularTransactionTypes(); | ||||
| $key = $this->getTransactionType(); | $key = $this->getTransactionType(); | ||||
| if (empty($types[$key])) { | if (empty($types[$key])) { | ||||
| $type = new PhabricatorCoreVoidTransaction(); | $type = $this->newFallbackModularTransactionType(); | ||||
| } else { | } else { | ||||
| $type = clone $types[$key]; | $type = clone $types[$key]; | ||||
| } | } | ||||
| $type->setStorage($this); | $type->setStorage($this); | ||||
| return $type; | return $type; | ||||
| } | } | ||||
| protected function newFallbackModularTransactionType() { | |||||
| return new PhabricatorCoreVoidTransaction(); | |||||
| } | |||||
| final public function generateOldValue($object) { | final public function generateOldValue($object) { | ||||
| return $this->getTransactionImplementation()->generateOldValue($object); | return $this->getTransactionImplementation()->generateOldValue($object); | ||||
| } | } | ||||
| final public function generateNewValue($object) { | final public function generateNewValue($object) { | ||||
| return $this->getTransactionImplementation() | return $this->getTransactionImplementation() | ||||
| ->generateNewValue($object, $this->getNewValue()); | ->generateNewValue($object, $this->getNewValue()); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines | |||||