2015-07-08 21:26:57 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DiffusionPreCommitContentRevisionAcceptedHeraldField
|
|
|
|
extends DiffusionPreCommitContentHeraldField {
|
|
|
|
|
|
|
|
const FIELDCONST = 'diffusion.pre.content.revision.accepted';
|
|
|
|
|
|
|
|
public function getHeraldFieldName() {
|
|
|
|
return pht('Accepted Differential revision');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
|
|
$revision = $this->getAdapter()->getRevision();
|
|
|
|
|
|
|
|
if (!$revision) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
$status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED;
|
|
|
|
if ($revision->getStatus() != $status_accepted) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $revision->getPHID();
|
|
|
|
}
|
|
|
|
|
2015-07-16 23:11:44 +02:00
|
|
|
protected function getHeraldFieldStandardType() {
|
2015-07-08 21:26:57 +02:00
|
|
|
return self::STANDARD_PHID_BOOL;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|