Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96326661
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
Wed, Dec 25, 08:15
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Dec 27, 08:15 (2 d)
Engine
blob
Format
Raw Data
Handle
23144407
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