Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/edittype/PhabricatorEdgeEditType.php
| Show All 12 Lines | final class PhabricatorEdgeEditType extends PhabricatorEditType { | ||||
| public function getEdgeOperation() { | public function getEdgeOperation() { | ||||
| return $this->edgeOperation; | return $this->edgeOperation; | ||||
| } | } | ||||
| public function getValueType() { | public function getValueType() { | ||||
| return 'list<phid>'; | return 'list<phid>'; | ||||
| } | } | ||||
| public function generateTransaction( | public function generateTransactions( | ||||
| PhabricatorApplicationTransaction $template, | PhabricatorApplicationTransaction $template, | ||||
| array $spec) { | array $spec) { | ||||
| $value = idx($spec, 'value'); | $value = idx($spec, 'value'); | ||||
| if ($this->getEdgeOperation() !== null) { | |||||
| $value = array_fuse($value); | $value = array_fuse($value); | ||||
| $value = array( | $value = array( | ||||
| $this->getEdgeOperation() => $value, | $this->getEdgeOperation() => $value, | ||||
| ); | ); | ||||
| } | |||||
| $template | $xaction = $this->newTransaction($template) | ||||
| ->setTransactionType($this->getTransactionType()) | |||||
| ->setNewValue($value); | ->setNewValue($value); | ||||
| foreach ($this->getMetadata() as $key => $value) { | return array($xaction); | ||||
| $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; | ||||
| } | } | ||||
| } | } | ||||