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) {
21 $packages = id(new PhabricatorOwnersPackageQuery())
23 ->withAuthorityPHIDs(array($committer_phid))
26 return mpull($packages, 'getPHID');
29 protected function getHeraldFieldStandardType() {
30 return self
::STANDARD_PHID_LIST
;
33 protected function getDatasource() {
34 return new PhabricatorOwnersPackageDatasource();