1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 19:02:41 +01:00
phorge-phorge/src/applications/differential/customfield/DifferentialHostField.php
epriestley f6a13fd1c7 Use CustomField, not AuxiliaryField, to power RevisionView
Summary: Ref T2222. This will probably have some rough edges for a bit (e.g., weird cases I didn't remember or think of), but there's no change to the underlying data and we can easily revert if things get too messy.

Test Plan: Looked at a variety of revisions and saw sensible output.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8361
2014-02-27 11:06:14 -08:00

39 lines
747 B
PHP

<?php
final class DifferentialHostField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:host';
}
public function getFieldName() {
return pht('Host');
}
public function getFieldDescription() {
return pht('Shows the local host where the diff came from.');
}
public function shouldDisableByDefault() {
return true;
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewLabel() {
return $this->getFieldName();
}
public function renderPropertyViewValue(array $handles) {
$host = $this->getObject()->getActiveDiff()->getSourceMachine();
if (!$host) {
return null;
}
return $host;
}
}