Differential D14508 Diff 35176 src/applications/transactions/storage/PhabricatorEditEngineConfigurationTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorEditEngineConfigurationTransaction.php
| <?php | <?php | ||||
| final class PhabricatorEditEngineConfigurationTransaction | final class PhabricatorEditEngineConfigurationTransaction | ||||
| extends PhabricatorApplicationTransaction { | extends PhabricatorApplicationTransaction { | ||||
| const TYPE_NAME = 'editengine.config.name'; | const TYPE_NAME = 'editengine.config.name'; | ||||
| const TYPE_PREAMBLE = 'editengine.config.preamble'; | const TYPE_PREAMBLE = 'editengine.config.preamble'; | ||||
| const TYPE_ORDER = 'editengine.config.order'; | const TYPE_ORDER = 'editengine.config.order'; | ||||
| const TYPE_DEFAULT = 'editengine.config.default'; | |||||
| public function getApplicationName() { | public function getApplicationName() { | ||||
| return 'search'; | return 'search'; | ||||
| } | } | ||||
| public function getApplicationTransactionType() { | public function getApplicationTransactionType() { | ||||
| return PhabricatorEditEngineConfigurationPHIDType::TYPECONST; | return PhabricatorEditEngineConfigurationPHIDType::TYPECONST; | ||||
| } | } | ||||
| public function getApplicationTransactionCommentObject() { | public function getApplicationTransactionCommentObject() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| public function getTitle() { | |||||
| $author_phid = $this->getAuthorPHID(); | |||||
| $old = $this->getOldValue(); | |||||
| $new = $this->getNewValue(); | |||||
| $type = $this->getTransactionType(); | |||||
| switch ($type) { | |||||
| case self::TYPE_NAME: | |||||
| if (strlen($old)) { | |||||
| return pht( | |||||
| '%s renamed this form from "%s" to "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $old, | |||||
| $new); | |||||
| } else { | |||||
| return pht( | |||||
| '%s named this form "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $new); | |||||
| } | |||||
| case self::TYPE_PREAMBLE: | |||||
| return pht( | |||||
| '%s updated the preamble for this form.', | |||||
| $this->renderHandleLink($author_phid)); | |||||
| case self::TYPE_ORDER: | |||||
| return pht( | |||||
| '%s reordered the fields in this form.', | |||||
| $this->renderHandleLink($author_phid)); | |||||
| case self::TYPE_DEFAULT: | |||||
| $key = $this->getMetadataValue('field.key'); | |||||
| return pht( | |||||
| '%s changed the default value for field "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $key); | |||||
| } | |||||
| return parent::getTitle(); | |||||
| } | |||||
| } | } | ||||