@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
at upstream/main 36 lines 824 B view raw
1<?php 2 3final 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}