Generate file attachment transactions for explicit Remarkup attachments on common...
[phabricator.git] / src / applications / diffusion / herald / DiffusionPreCommitContentAuthorPackagesHeraldField.php
blob9832958faff4ffef54a274b705a3c84a76aeabcf
1 <?php
3 final class DiffusionPreCommitContentAuthorPackagesHeraldField
4 extends DiffusionPreCommitContentHeraldField {
6 const FIELDCONST = 'diffusion.pre.commit.author.packages';
8 public function getHeraldFieldName() {
9 return pht("Author's packages");
12 public function getHeraldFieldValue($object) {
13 $adapter = $this->getAdapter();
14 $viewer = $adapter->getViewer();
16 $author_phid = $adapter->getAuthorPHID();
17 if (!$author_phid) {
18 return array();
21 $packages = id(new PhabricatorOwnersPackageQuery())
22 ->setViewer($viewer)
23 ->withAuthorityPHIDs(array($author_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();