Differential D17044 Diff 41007 src/applications/transactions/storage/PhabricatorModularTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorModularTransaction.php
| <?php | <?php | ||||
| // TODO: Some "final" modifiers have been VERY TEMPORARILY moved aside to | |||||
| // allow DifferentialTransaction to extend this class without converting | |||||
| // fully to ModularTransactions. | |||||
| abstract class PhabricatorModularTransaction | abstract class PhabricatorModularTransaction | ||||
| extends PhabricatorApplicationTransaction { | extends PhabricatorApplicationTransaction { | ||||
| private $implementation; | private $implementation; | ||||
| abstract public function getBaseTransactionClass(); | abstract public function getBaseTransactionClass(); | ||||
| public function getModularType() { | public function getModularType() { | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | return $this->getTransactionImplementation() | ||||
| ->applyInternalEffects($object); | ->applyInternalEffects($object); | ||||
| } | } | ||||
| final public function applyExternalEffects($object) { | final public function applyExternalEffects($object) { | ||||
| return $this->getTransactionImplementation() | return $this->getTransactionImplementation() | ||||
| ->applyExternalEffects($object); | ->applyExternalEffects($object); | ||||
| } | } | ||||
| final public function shouldHide() { | /* final */ public function shouldHide() { | ||||
| if ($this->getTransactionImplementation()->shouldHide()) { | if ($this->getTransactionImplementation()->shouldHide()) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| return parent::shouldHide(); | return parent::shouldHide(); | ||||
| } | } | ||||
| final public function getIcon() { | /* final */ public function getIcon() { | ||||
| $icon = $this->getTransactionImplementation()->getIcon(); | $icon = $this->getTransactionImplementation()->getIcon(); | ||||
| if ($icon !== null) { | if ($icon !== null) { | ||||
| return $icon; | return $icon; | ||||
| } | } | ||||
| return parent::getIcon(); | return parent::getIcon(); | ||||
| } | } | ||||
| final public function getTitle() { | /* final */ public function getTitle() { | ||||
| $title = $this->getTransactionImplementation()->getTitle(); | $title = $this->getTransactionImplementation()->getTitle(); | ||||
| if ($title !== null) { | if ($title !== null) { | ||||
| return $title; | return $title; | ||||
| } | } | ||||
| return parent::getTitle(); | return parent::getTitle(); | ||||
| } | } | ||||
| public function getTitleForMail() { | public function getTitleForMail() { | ||||
| $old_target = $this->getRenderingTarget(); | $old_target = $this->getRenderingTarget(); | ||||
| $new_target = self::TARGET_TEXT; | $new_target = self::TARGET_TEXT; | ||||
| $this->setRenderingTarget($new_target); | $this->setRenderingTarget($new_target); | ||||
| $title = $this->getTitle(); | $title = $this->getTitle(); | ||||
| $this->setRenderingTarget($old_target); | $this->setRenderingTarget($old_target); | ||||
| return $title; | return $title; | ||||
| } | } | ||||
| final public function getTitleForFeed() { | /* final */ public function getTitleForFeed() { | ||||
| $title = $this->getTransactionImplementation()->getTitleForFeed(); | $title = $this->getTransactionImplementation()->getTitleForFeed(); | ||||
| if ($title !== null) { | if ($title !== null) { | ||||
| return $title; | return $title; | ||||
| } | } | ||||
| return parent::getTitleForFeed(); | return parent::getTitleForFeed(); | ||||
| } | } | ||||
| final public function getColor() { | /* final */ public function getColor() { | ||||
| $color = $this->getTransactionImplementation()->getColor(); | $color = $this->getTransactionImplementation()->getColor(); | ||||
| if ($color !== null) { | if ($color !== null) { | ||||
| return $color; | return $color; | ||||
| } | } | ||||
| return parent::getColor(); | return parent::getColor(); | ||||
| } | } | ||||
| Show All 29 Lines | |||||