Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / herald / DiffusionPreCommitContentCommitterPackagesHeraldField.php
blobcd4674ef0747a443306484e54d2f563272b8e48e
1 <?php
3 final class DiffusionPreCommitContentCommitterPackagesHeraldField
4 extends DiffusionPreCommitContentHeraldField {
6 const FIELDCONST = 'diffusion.pre.commit.committer.packages';
8 public function getHeraldFieldName() {
9 return pht("Committer's packages");
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 $packages = id(new PhabricatorOwnersPackageQuery())
22 ->setViewer($viewer)
23 ->withAuthorityPHIDs(array($committer_phid))
24 ->execute();
26 return mpull($packages, 'getPHID');
29 protected function getHeraldFieldStandardType() {
30 return self::STANDARD_PHID_LIST;
33 protected function getDatasource() {
34 return new PhabricatorOwnersPackageDatasource();