Differential D14635 Diff 35412 src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php
| Show All 30 Lines | protected function buildControl() { | ||||
| $value = $this->getValue(); | $value = $this->getValue(); | ||||
| $clone->setValueFromApplicationTransactions($value); | $clone->setValueFromApplicationTransactions($value); | ||||
| return $clone->renderEditControl(array()); | return $clone->renderEditControl(array()); | ||||
| } | } | ||||
| protected function newEditType() { | protected function newEditType() { | ||||
| return id(new PhabricatorCustomFieldEditType()) | $type = id(new PhabricatorCustomFieldEditType()) | ||||
| ->setCustomField($this->getCustomField()); | ->setCustomField($this->getCustomField()); | ||||
| $http_type = $this->getHTTPParameterType(); | |||||
| if ($http_type) { | |||||
| $type->setValueType($http_type->getTypeName()); | |||||
| } | |||||
| return $type; | |||||
| } | } | ||||
| public function getValueForTransaction() { | public function getValueForTransaction() { | ||||
| $value = $this->getValue(); | $value = $this->getValue(); | ||||
| $field = $this->getCustomField(); | $field = $this->getCustomField(); | ||||
| // Avoid changing the value of the field itself, since later calls would | // Avoid changing the value of the field itself, since later calls would | ||||
| // incorrectly reflect the new value. | // incorrectly reflect the new value. | ||||
| Show All 11 Lines | protected function getValueFromSubmit(AphrontRequest $request, $key) { | ||||
| $clone = clone $field; | $clone = clone $field; | ||||
| $clone->readValueFromRequest($request); | $clone->readValueFromRequest($request); | ||||
| return $clone->getNewValueForApplicationTransactions(); | return $clone->getNewValueForApplicationTransactions(); | ||||
| } | } | ||||
| public function getConduitEditTypes() { | public function getConduitEditTypes() { | ||||
| // TODO: For now, don't support custom fields over Conduit. | $field = $this->getCustomField(); | ||||
| if (!$field->shouldAppearInConduitTransactions()) { | |||||
| return array(); | return array(); | ||||
| } | } | ||||
| return parent::getConduitEditTypes(); | |||||
| } | |||||
| protected function newHTTPParameterType() { | protected function newHTTPParameterType() { | ||||
| $type = $this->getCustomFieldHTTPParameterType(); | $type = $this->getCustomFieldHTTPParameterType(); | ||||
| if ($type) { | if ($type) { | ||||
| return clone $type; | return clone $type; | ||||
| } | } | ||||
| return null; | return null; | ||||
| Show All 21 Lines | |||||