2015-07-08 21:25:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialRevisionRepositoryHeraldField
|
|
|
|
extends DifferentialRevisionHeraldField {
|
|
|
|
|
|
|
|
const FIELDCONST = 'differential.revision.repository';
|
|
|
|
|
|
|
|
public function getHeraldFieldName() {
|
|
|
|
return pht('Repository');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
|
|
$repository = $this->getAdapter()->loadRepository();
|
|
|
|
|
|
|
|
if (!$repository) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $repository->getPHID();
|
|
|
|
}
|
|
|
|
|
2015-07-16 23:11:44 +02:00
|
|
|
protected function getHeraldFieldStandardType() {
|
2015-07-08 21:25:48 +02:00
|
|
|
return self::STANDARD_PHID_NULLABLE;
|
|
|
|
}
|
|
|
|
|
2015-07-16 23:12:44 +02:00
|
|
|
protected function getDatasource() {
|
|
|
|
return new DiffusionRepositoryDatasource();
|
2015-07-08 21:25:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|