1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-16 03:42:41 +01:00
phorge-phorge/src/applications/differential/customfield/DifferentialDependsOnField.php
epriestley 48059265f3 Use CustomFields to power Conduit auxiliary dictionaries
Summary: Ref T2222. Moves this Conduit stuff over.

Test Plan: Made Conduit calls, saw data in results.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8469
2014-03-11 13:02:09 -07:00

62 lines
1.4 KiB
PHP

<?php
final class DifferentialDependsOnField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:depends-on';
}
public function getFieldKeyForConduit() {
return 'phabricator:depends-on';
}
public function getFieldName() {
return pht('Depends On');
}
public function canDisableField() {
return false;
}
public function getFieldDescription() {
return pht('Lists revisions this one depends on.');
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewLabel() {
return $this->getFieldName();
}
public function getRequiredHandlePHIDsForPropertyView() {
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getObject()->getPHID(),
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV);
}
public function renderPropertyViewValue(array $handles) {
return $this->renderHandleList($handles);
}
public function getProTips() {
return array(
pht(
'Create a dependendency between revisions by writing '.
'"Depends on D123" in your summary.'),
);
}
public function shouldAppearInConduitDictionary() {
return true;
}
public function getConduitDictionaryValue() {
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getObject()->getPHID(),
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV);
}
}