Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / herald / DiffusionPreCommitContentCommitterProjectsHeraldField.php
blob109649241ff2ae8745655efcbdecd629d85ff501
1 <?php
3 final class DiffusionPreCommitContentCommitterProjectsHeraldField
4 extends DiffusionPreCommitContentHeraldField {
6 const FIELDCONST = 'diffusion.pre.commit.committer.projects';
8 public function getHeraldFieldName() {
9 return pht("Committer's projects");
12 public function getHeraldFieldValue($object) {
13 $adapter = $this->getAdapter();
14 $viewer = $adapter->getViewer();
16 $committer_phid = $adapter->getCommitterPHID();
17 if (!$committer_phid) {
18 return array();
21 $projects = id(new PhabricatorProjectQuery())
22 ->setViewer($viewer)
23 ->withMemberPHIDs(array($committer_phid))
24 ->execute();
26 return mpull($projects, 'getPHID');
29 protected function getHeraldFieldStandardType() {
30 return self::STANDARD_PHID_LIST;
33 protected function getDatasource() {
34 return new PhabricatorProjectDatasource();