Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F436896
PhabricatorIDsSearchEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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'
]);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 12:24 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
62891
Default Alt Text
PhabricatorIDsSearchEngineExtension.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment