@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DiffusionPreCommitContentPackageOwnerHeraldField
4 extends DiffusionPreCommitContentHeraldField {
5
6 const FIELDCONST = 'diffusion.pre.content.package.owners';
7
8 public function getHeraldFieldName() {
9 return pht('Affected package owners');
10 }
11
12 public function getFieldGroupKey() {
13 return HeraldRelatedFieldGroup::FIELDGROUPKEY;
14 }
15
16 public function getHeraldFieldValue($object) {
17 $packages = $this->getAdapter()->loadAffectedPackages();
18 if (!$packages) {
19 return array();
20 }
21
22 $owners = PhabricatorOwnersOwner::loadAllForPackages($packages);
23 return mpull($owners, 'getUserPHID');
24 }
25
26 protected function getHeraldFieldStandardType() {
27 return self::STANDARD_PHID_LIST;
28 }
29
30 protected function getDatasource() {
31 return new PhabricatorProjectOrUserDatasource();
32 }
33
34}