Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/engineextension/DiffusionRepositoryURIsSearchEngineAttachment.php
12242 views
1
<?php
2
3
final 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
}
35
36