@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 34 lines 799 B view raw
1<?php 2 3final class DiffusionRepositoryURIsSearchEngineAttachment 4 extends PhabricatorSearchEngineAttachment { 5 6 public function getAttachmentName() { 7 return pht('Repository URIs'); 8 } 9 10 public function getAttachmentDescription() { 11 return pht('Get a list of associated URIs for each repository.'); 12 } 13 14 public function willLoadAttachmentData($query, $spec) { 15 $query->needURIs(true); 16 } 17 18 public function getAttachmentForObject($object, $data, $spec) { 19 $uris = array(); 20 foreach ($object->getURIs() as $uri) { 21 $uris[] = array( 22 'id' => $uri->getID(), 23 'type' => phid_get_type($uri->getPHID()), 24 'phid' => $uri->getPHID(), 25 'fields' => $uri->getFieldValuesForConduit(), 26 ); 27 } 28 29 return array( 30 'uris' => $uris, 31 ); 32 } 33 34}