2015-07-08 12:26:00 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DiffusionPreCommitRefChangeHeraldField
|
|
|
|
extends DiffusionPreCommitRefHeraldField {
|
|
|
|
|
|
|
|
const FIELDCONST = 'diffusion.pre.ref.change';
|
|
|
|
|
|
|
|
public function getHeraldFieldName() {
|
|
|
|
return pht('Ref change type');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
|
|
return $object->getChangeFlags();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldFieldConditions() {
|
|
|
|
return array(
|
|
|
|
HeraldAdapter::CONDITION_HAS_BIT,
|
|
|
|
HeraldAdapter::CONDITION_NOT_BIT,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldFieldValueType($condition) {
|
2015-07-16 14:12:23 -07:00
|
|
|
return id(new HeraldSelectFieldValue())
|
|
|
|
->setKey(self::FIELDCONST)
|
|
|
|
->setOptions(
|
|
|
|
PhabricatorRepositoryPushLog::getHeraldChangeFlagConditionOptions())
|
|
|
|
->setDefault(PhabricatorRepositoryPushLog::CHANGEFLAG_ADD);
|
2015-07-08 12:26:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|