2011-08-14 21:33:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialDependenciesFieldSpecification
|
|
|
|
extends DifferentialFieldSpecification {
|
|
|
|
|
|
|
|
public function shouldAppearOnRevisionView() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRequiredHandlePHIDsForRevisionView() {
|
|
|
|
return $this->getDependentRevisionPHIDs();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderLabelForRevisionView() {
|
2012-08-29 00:24:01 +02:00
|
|
|
return 'Dependents:';
|
2011-08-14 21:33:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function renderValueForRevisionView() {
|
|
|
|
$revision_phids = $this->getDependentRevisionPHIDs();
|
|
|
|
if (!$revision_phids) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
$links = array();
|
|
|
|
foreach ($revision_phids as $revision_phids) {
|
|
|
|
$links[] = $this->getHandle($revision_phids)->renderLink();
|
|
|
|
}
|
|
|
|
|
2013-02-13 23:50:15 +01:00
|
|
|
return phutil_implode_html(phutil_tag('br'), $links);
|
2011-08-14 21:33:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private function getDependentRevisionPHIDs() {
|
2012-07-19 05:42:06 +02:00
|
|
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
|
|
$this->getRevision()->getPHID(),
|
2012-08-29 00:24:01 +02:00
|
|
|
PhabricatorEdgeConfig::TYPE_DREV_DEPENDED_ON_BY_DREV);
|
2011-08-14 21:33:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|