Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / herald / DiffusionCommitRevisionAcceptingReviewersHeraldField.php
blob6d266f135753f30ee0830f122b0317d66e6fdb3b
1 <?php
3 final class DiffusionCommitRevisionAcceptingReviewersHeraldField
4 extends DiffusionCommitHeraldField {
6 const FIELDCONST = 'diffusion.commit.revision.accepting';
8 public function getHeraldFieldName() {
9 return pht('Accepting reviewers');
12 public function getFieldGroupKey() {
13 return HeraldRelatedFieldGroup::FIELDGROUPKEY;
16 public function getHeraldFieldValue($object) {
17 $revision = $this->getAdapter()->loadDifferentialRevision();
19 if (!$revision) {
20 return array();
23 $diff_phid = $revision->getActiveDiffPHID();
25 $reviewer_phids = array();
26 foreach ($revision->getReviewers() as $reviewer) {
27 if ($reviewer->isAccepted($diff_phid)) {
28 $reviewer_phids[] = $reviewer->getReviewerPHID();
32 return $reviewer_phids;
35 protected function getHeraldFieldStandardType() {
36 return self::STANDARD_PHID_LIST;
39 protected function getDatasource() {
40 return new DifferentialReviewerDatasource();