Differential D17066 Diff 41082 src/applications/differential/field/DifferentialTagsCommitMessageField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/field/DifferentialTagsCommitMessageField.php
| <?php | <?php | ||||
| final class DifferentialTagsCommitMessageField | final class DifferentialTagsCommitMessageField | ||||
| extends DifferentialCommitMessageField { | extends DifferentialCommitMessageField { | ||||
| const FIELDKEY = 'phabricator:projects'; | const FIELDKEY = 'phabricator:projects'; | ||||
| public function getFieldName() { | public function getFieldName() { | ||||
| return pht('Tags'); | return pht('Tags'); | ||||
| } | } | ||||
| public function getFieldOrder() { | |||||
| return 7000; | |||||
| } | |||||
| public function getFieldAliases() { | public function getFieldAliases() { | ||||
| return array( | return array( | ||||
| 'Tag', | 'Tag', | ||||
| 'Project', | 'Project', | ||||
| 'Projects', | 'Projects', | ||||
| ); | ); | ||||
| } | } | ||||
| public function isTemplateField() { | |||||
| return false; | |||||
| } | |||||
| public function parseFieldValue($value) { | public function parseFieldValue($value) { | ||||
| return $this->parseObjectList( | return $this->parseObjectList( | ||||
| $value, | $value, | ||||
| array( | array( | ||||
| PhabricatorProjectProjectPHIDType::TYPECONST, | PhabricatorProjectProjectPHIDType::TYPECONST, | ||||
| )); | )); | ||||
| } | } | ||||
| public function readFieldValueFromObject(DifferentialRevision $revision) { | |||||
| if (!$revision->getPHID()) { | |||||
| return array(); | |||||
| } | |||||
| $projects = PhabricatorEdgeQuery::loadDestinationPHIDs( | |||||
| $revision->getPHID(), | |||||
| PhabricatorProjectObjectHasProjectEdgeType::EDGECONST); | |||||
| $projects = array_reverse($projects); | |||||
| return $projects; | |||||
| } | |||||
| public function readFieldValueFromConduit($value) { | |||||
| return $this->readStringListFieldValueFromConduit($value); | |||||
| } | |||||
| public function renderFieldValue($value) { | |||||
| return $this->renderHandleList($value); | |||||
| } | |||||
| } | } | ||||