2015-07-08 12:26:57 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DiffusionPreCommitContentRevisionReviewersHeraldField
|
|
|
|
extends DiffusionPreCommitContentHeraldField {
|
|
|
|
|
|
|
|
const FIELDCONST = 'diffusion.pre.content.revision.reviewers';
|
|
|
|
|
|
|
|
public function getHeraldFieldName() {
|
|
|
|
return pht('Differential reviewers');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
|
|
$revision = $this->getAdapter()->getRevision();
|
|
|
|
|
|
|
|
if (!$revision) {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $revision->getReviewers();
|
|
|
|
}
|
|
|
|
|
2015-07-16 14:11:44 -07:00
|
|
|
protected function getHeraldFieldStandardType() {
|
|
|
|
return self::STANDARD_PHID_LIST;
|
2015-07-08 12:26:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldFieldValueType($condition) {
|
|
|
|
switch ($condition) {
|
|
|
|
case HeraldAdapter::CONDITION_EXISTS:
|
|
|
|
case HeraldAdapter::CONDITION_NOT_EXISTS:
|
|
|
|
return HeraldAdapter::VALUE_NONE;
|
|
|
|
default:
|
|
|
|
return HeraldAdapter::VALUE_USER_OR_PROJECT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|