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/field/specification/DifferentialDependenciesFieldSpecification.php

39 lines
950 B
PHP
Raw Normal View History

<?php
final class DifferentialDependenciesFieldSpecification
extends DifferentialFieldSpecification {
public function shouldAppearOnRevisionView() {
return true;
}
public function getRequiredHandlePHIDsForRevisionView() {
return $this->getDependentRevisionPHIDs();
}
public function renderLabelForRevisionView() {
return 'Dependents:';
}
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);
}
private function getDependentRevisionPHIDs() {
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getRevision()->getPHID(),
PhabricatorEdgeConfig::TYPE_DREV_DEPENDED_ON_BY_DREV);
}
}