Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/differential/herald/DifferentialDiffAuthorProjectsHeraldField.php
12256 views
1
<?php
2
3
final class DifferentialDiffAuthorProjectsHeraldField
4
extends DifferentialDiffHeraldField {
5
6
const FIELDCONST = 'differential.diff.author.projects';
7
8
public function getHeraldFieldName() {
9
return pht("Author's projects");
10
}
11
12
public function getHeraldFieldValue($object) {
13
$viewer = PhabricatorUser::getOmnipotentUser();
14
15
$projects = id(new PhabricatorProjectQuery())
16
->setViewer($viewer)
17
->withMemberPHIDs(array($object->getAuthorPHID()))
18
->execute();
19
20
return mpull($projects, 'getPHID');
21
}
22
23
protected function getHeraldFieldStandardType() {
24
return self::STANDARD_PHID_LIST;
25
}
26
27
protected function getDatasource() {
28
return new PhabricatorProjectDatasource();
29
}
30
31
}
32
33