Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php
12242 views
1
<?php
2
3
final class DiffusionAuditorsSearchEngineAttachment
4
extends PhabricatorSearchEngineAttachment {
5
6
public function getAttachmentName() {
7
return pht('Diffusion Auditors');
8
}
9
10
public function getAttachmentDescription() {
11
return pht('Get the auditors for each commit.');
12
}
13
14
public function willLoadAttachmentData($query, $spec) {
15
$query->needAuditRequests(true);
16
}
17
18
public function getAttachmentForObject($object, $data, $spec) {
19
$auditors = $object->getAudits();
20
21
$list = array();
22
foreach ($auditors as $auditor) {
23
$status = $auditor->getAuditRequestStatusObject();
24
25
$list[] = array(
26
'auditorPHID' => $auditor->getAuditorPHID(),
27
'status' => $status->getStatusValueForConduit(),
28
);
29
}
30
31
return array(
32
'auditors' => $list,
33
);
34
}
35
36
}
37
38