Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93458214
PhabricatorProjectsSearchEngineAttachment.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Nov 28, 22:23
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Nov 30, 22:23 (2 d)
Engine
blob
Format
Raw Data
Handle
22643763
Attached To
rPH Phabricator
PhabricatorProjectsSearchEngineAttachment.php
View Options
<?php
final
class
PhabricatorProjectsSearchEngineAttachment
extends
PhabricatorSearchEngineAttachment
{
public
function
getAttachmentName
()
{
return
pht
(
'Projects'
);
}
public
function
getAttachmentDescription
()
{
return
pht
(
'Get information about projects.'
);
}
public
function
loadAttachmentData
(
array
$objects
,
$spec
)
{
$object_phids
=
mpull
(
$objects
,
'getPHID'
);
$projects_query
=
id
(
new
PhabricatorEdgeQuery
())
->
withSourcePHIDs
(
$object_phids
)
->
withEdgeTypes
(
array
(
PhabricatorProjectObjectHasProjectEdgeType
::
EDGECONST
,
));
$projects_query
->
execute
();
return
array
(
'projects.query'
=>
$projects_query
,
);
}
public
function
getAttachmentForObject
(
$object
,
$data
,
$spec
)
{
$projects_query
=
$data
[
'projects.query'
];
$object_phid
=
$object
->
getPHID
();
$project_phids
=
$projects_query
->
getDestinationPHIDs
(
array
(
$object_phid
),
array
(
PhabricatorProjectObjectHasProjectEdgeType
::
EDGECONST
));
return
array
(
'projectPHIDs'
=>
array_values
(
$project_phids
),
);
}
}
Event Timeline
Log In to Comment