Page MenuHomec4science

DiffusionCommitRevisionAcceptedHeraldField.php
No OneTemporary

File Metadata

Created
Sat, Jan 4, 19:06

DiffusionCommitRevisionAcceptedHeraldField.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 getHeraldFieldStandardType() {
return self::STANDARD_PHID_BOOL;
}
}

Event Timeline