Differential D17132 Diff 41201 src/applications/transactions/editfield/PhabricatorApplyEditField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editfield/PhabricatorApplyEditField.php
| <?php | <?php | ||||
| final class PhabricatorApplyEditField | final class PhabricatorApplyEditField | ||||
| extends PhabricatorEditField { | extends PhabricatorEditField { | ||||
| private $actionDescription; | private $actionDescription; | ||||
| private $actionConflictKey; | |||||
| protected function newControl() { | protected function newControl() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| public function setActionDescription($action_description) { | public function setActionDescription($action_description) { | ||||
| $this->actionDescription = $action_description; | $this->actionDescription = $action_description; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getActionDescription() { | public function getActionDescription() { | ||||
| return $this->actionDescription; | return $this->actionDescription; | ||||
| } | } | ||||
| public function setActionConflictKey($action_conflict_key) { | |||||
| $this->actionConflictKey = $action_conflict_key; | |||||
| return $this; | |||||
| } | |||||
| public function getActionConflictKey() { | |||||
| return $this->actionConflictKey; | |||||
| } | |||||
| protected function newHTTPParameterType() { | protected function newHTTPParameterType() { | ||||
| return new AphrontBoolHTTPParameterType(); | return new AphrontBoolHTTPParameterType(); | ||||
| } | } | ||||
| protected function newConduitParameterType() { | protected function newConduitParameterType() { | ||||
| return new ConduitBoolParameterType(); | return new ConduitBoolParameterType(); | ||||
| } | } | ||||
| public function shouldGenerateTransactionsFromSubmit() { | public function shouldGenerateTransactionsFromSubmit() { | ||||
| // This type of edit field just applies a prebuilt action, like "Accept | // This type of edit field just applies a prebuilt action, like "Accept | ||||
| // Revision", and can not be submitted as part of an "Edit Object" form. | // Revision", and can not be submitted as part of an "Edit Object" form. | ||||
| return false; | return false; | ||||
| } | } | ||||
| protected function newCommentAction() { | protected function newCommentAction() { | ||||
| return id(new PhabricatorEditEngineStaticCommentAction()) | return id(new PhabricatorEditEngineStaticCommentAction()) | ||||
| ->setDescription($this->getActionDescription()); | ->setDescription($this->getActionDescription()) | ||||
| ->setConflictKey($this->getActionConflictKey()); | |||||
| } | } | ||||
| } | } | ||||