Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/edittype/PhabricatorSimpleEditType.php
| <?php | <?php | ||||
| final class PhabricatorSimpleEditType extends PhabricatorEditType { | final class PhabricatorSimpleEditType extends PhabricatorEditType { | ||||
| private $valueType; | private $valueType; | ||||
| private $valueDescription; | private $valueDescription; | ||||
| public function setValueType($value_type) { | public function setValueType($value_type) { | ||||
| $this->valueType = $value_type; | $this->valueType = $value_type; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getValueType() { | public function getValueType() { | ||||
| return $this->valueType; | return $this->valueType; | ||||
| } | } | ||||
| public function generateTransaction( | public function generateTransactions( | ||||
| PhabricatorApplicationTransaction $template, | PhabricatorApplicationTransaction $template, | ||||
| array $spec) { | array $spec) { | ||||
| $template | $edit = $this->newTransaction($template) | ||||
| ->setTransactionType($this->getTransactionType()) | |||||
| ->setNewValue(idx($spec, 'value')); | ->setNewValue(idx($spec, 'value')); | ||||
| foreach ($this->getMetadata() as $key => $value) { | return array($edit); | ||||
| $template->setMetadataValue($key, $value); | |||||
| } | |||||
| return $template; | |||||
| } | } | ||||
| public function setValueDescription($value_description) { | public function setValueDescription($value_description) { | ||||
| $this->valueDescription = $value_description; | $this->valueDescription = $value_description; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getValueDescription() { | public function getValueDescription() { | ||||
| return $this->valueDescription; | return $this->valueDescription; | ||||
| } | } | ||||
| } | } | ||||