2014-02-26 23:46:18 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialDependsOnField
|
|
|
|
extends DifferentialCustomField {
|
|
|
|
|
|
|
|
public function getFieldKey() {
|
|
|
|
return 'differential:depends-on';
|
|
|
|
}
|
|
|
|
|
2014-03-09 19:23:55 +01:00
|
|
|
public function getFieldKeyForConduit() {
|
|
|
|
return 'phabricator:depends-on';
|
|
|
|
}
|
|
|
|
|
2014-02-26 23:46:18 +01:00
|
|
|
public function getFieldName() {
|
|
|
|
return pht('Depends On');
|
|
|
|
}
|
|
|
|
|
2014-03-08 18:13:51 +01:00
|
|
|
public function canDisableField() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-02-26 23:46:18 +01:00
|
|
|
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(),
|
2015-01-01 04:43:26 +01:00
|
|
|
DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST);
|
2014-02-26 23:46:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function renderPropertyViewValue(array $handles) {
|
|
|
|
return $this->renderHandleList($handles);
|
|
|
|
}
|
|
|
|
|
2014-03-08 02:05:00 +01:00
|
|
|
public function getProTips() {
|
|
|
|
return array(
|
|
|
|
pht(
|
2014-07-30 21:59:28 +02:00
|
|
|
'Create a dependency between revisions by writing '.
|
2014-03-08 02:05:00 +01:00
|
|
|
'"Depends on D123" in your summary.'),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-03-09 19:23:55 +01:00
|
|
|
public function shouldAppearInConduitDictionary() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getConduitDictionaryValue() {
|
|
|
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
|
|
$this->getObject()->getPHID(),
|
2015-01-01 04:43:26 +01:00
|
|
|
DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST);
|
2014-03-09 19:23:55 +01:00
|
|
|
}
|
|
|
|
|
2014-02-26 23:46:18 +01:00
|
|
|
}
|