Differential D13601 Diff 32881 src/applications/diffusion/herald/DiffusionPreCommitContentRevisionReviewersHeraldField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/herald/DiffusionPreCommitContentRevisionReviewersHeraldField.php
- This file was added.
<?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(); | |||||
} | |||||
protected function getHeraldFieldStandardConditions() { | |||||
return self::STANDARD_LIST; | |||||
} | |||||
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; | |||||
} | |||||
} | |||||
} |