mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-26 13:39:08 +01:00
41 lines
963 B
PHP
41 lines
963 B
PHP
|
<?php
|
||
|
|
||
|
final class DiffusionCommitRevisionAcceptedHeraldField
|
||
|
extends DiffusionCommitHeraldField {
|
||
|
|
||
|
const FIELDCONST = 'diffusion.commit.revision.accepted';
|
||
|
|
||
|
public function getHeraldFieldName() {
|
||
|
return pht('Accepted Differential revision');
|
||
|
}
|
||
|
|
||
|
public function getHeraldFieldValue($object) {
|
||
|
$revision = $this->getAdapter()->loadDifferentialRevision();
|
||
|
if (!$revision) {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
$data = $object->getCommitData();
|
||
|
$status = $data->getCommitDetail(
|
||
|
'precommitRevisionStatus',
|
||
|
$revision->getStatus());
|
||
|
|
||
|
switch ($status) {
|
||
|
case ArcanistDifferentialRevisionStatus::ACCEPTED:
|
||
|
case ArcanistDifferentialRevisionStatus::CLOSED:
|
||
|
return $revision->getPHID();
|
||
|
}
|
||
|
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
protected function getHeraldFieldStandardConditions() {
|
||
|
return self::STANDARD_PHID_BOOL;
|
||
|
}
|
||
|
|
||
|
public function getHeraldFieldValueType($condition) {
|
||
|
return HeraldAdapter::VALUE_NONE;
|
||
|
}
|
||
|
|
||
|
}
|