Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editfield/PhabricatorEditField.php
| Show First 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | abstract class PhabricatorEditField extends Phobject { | ||||
| public function getEditTypeKey() { | public function getEditTypeKey() { | ||||
| if ($this->editTypeKey === null) { | if ($this->editTypeKey === null) { | ||||
| return $this->getKey(); | return $this->getKey(); | ||||
| } | } | ||||
| return $this->editTypeKey; | return $this->editTypeKey; | ||||
| } | } | ||||
| protected function newEditType() { | |||||
| return id(new PhabricatorSimpleEditType()) | |||||
| ->setValueType($this->getHTTPParameterType()->getTypeName()); | |||||
| } | |||||
| public function getEditTransactionTypes() { | public function getEditTransactionTypes() { | ||||
| $transaction_type = $this->getTransactionType(); | $transaction_type = $this->getTransactionType(); | ||||
| if ($transaction_type === null) { | if ($transaction_type === null) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| $type_key = $this->getEditTypeKey(); | $type_key = $this->getEditTypeKey(); | ||||
| Show All 38 Lines | if (isset($edge_types[$transaction_type])) { | ||||
| return array( | return array( | ||||
| $add, | $add, | ||||
| $rem, | $rem, | ||||
| $set, | $set, | ||||
| ); | ); | ||||
| } | } | ||||
| return array( | return array( | ||||
| id(new PhabricatorSimpleEditType()) | $this->newEditType() | ||||
| ->setEditType($type_key) | ->setEditType($type_key) | ||||
| ->setTransactionType($transaction_type) | ->setTransactionType($transaction_type) | ||||
| ->setValueType($this->getHTTPParameterType()->getTypeName()) | |||||
| ->setDescription($this->getDescription()) | ->setDescription($this->getDescription()) | ||||
| ->setMetadata($this->metadata), | ->setMetadata($this->metadata), | ||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||