2014-02-27 01:53:42 +01:00
|
|
|
<?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.');
|
|
|
|
}
|
|
|
|
|
2014-02-27 20:06:14 +01:00
|
|
|
public function shouldDisableByDefault() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-02-27 01:53:42 +01:00
|
|
|
public function shouldAppearInPropertyView() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-06-16 17:53:40 +02:00
|
|
|
public function renderPropertyViewValue(array $handles) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldAppearInDiffPropertyView() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderDiffPropertyViewLabel(DifferentialDiff $diff) {
|
2014-02-27 01:53:42 +01:00
|
|
|
return $this->getFieldName();
|
|
|
|
}
|
|
|
|
|
2015-06-16 17:53:40 +02:00
|
|
|
public function renderDiffPropertyViewValue(DifferentialDiff $diff) {
|
|
|
|
$host = $diff->getSourceMachine();
|
2014-02-27 01:53:42 +01:00
|
|
|
if (!$host) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $host;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|