Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92783422
PhabricatorIDsSearchEngineExtension.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
Sat, Nov 23, 16:48
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 16:48 (2 d)
Engine
blob
Format
Raw Data
Handle
22513793
Attached To
rPH Phabricator
PhabricatorIDsSearchEngineExtension.php
View Options
<?php
final
class
PhabricatorIDsSearchEngineExtension
extends
PhabricatorSearchEngineExtension
{
const
EXTENSIONKEY
=
'ids'
;
public
function
isExtensionEnabled
()
{
return
true
;
}
public
function
getExtensionName
()
{
return
pht
(
'Supports ID/PHID Queries'
);
}
public
function
getExtensionOrder
()
{
return
1000
;
}
public
function
supportsObject
(
$object
)
{
return
true
;
}
public
function
getSearchFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorIDsSearchField
())
->
setKey
(
'ids'
)
->
setLabel
(
pht
(
'IDs'
))
->
setDescription
(
pht
(
'Search for objects with specific IDs.'
)),
id
(
new
PhabricatorPHIDsSearchField
())
->
setKey
(
'phids'
)
->
setLabel
(
pht
(
'PHIDs'
))
->
setDescription
(
pht
(
'Search for objects with specific PHIDs.'
)),
);
}
public
function
applyConstraintsToQuery
(
$object
,
$query
,
PhabricatorSavedQuery
$saved
,
array
$map
)
{
if
(
$map
[
'ids'
])
{
$query
->
withIDs
(
$map
[
'ids'
]);
}
if
(
$map
[
'phids'
])
{
$query
->
withPHIDs
(
$map
[
'phids'
]);
}
}
}
Event Timeline
Log In to Comment