Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102795706
PhabricatorFlagSearchEngine.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
Mon, Feb 24, 06:42
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Feb 26, 06:42 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
24426934
Attached To
rPH Phabricator
PhabricatorFlagSearchEngine.php
View Options
<?php
final
class
PhabricatorFlagSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
buildSavedQueryFromRequest
(
AphrontRequest
$request
)
{
$saved
=
new
PhabricatorSavedQuery
();
$saved
->
setParameter
(
'colors'
,
$request
->
getArr
(
'colors'
));
return
$saved
;
}
public
function
buildQueryFromSavedQuery
(
PhabricatorSavedQuery
$saved
)
{
$query
=
id
(
new
PhabricatorFlagQuery
())
->
needHandles
(
true
)
->
withOwnerPHIDs
(
array
(
$this
->
requireViewer
()->
getPHID
()));
$colors
=
$saved
->
getParameter
(
'colors'
);
if
(
$colors
)
{
$query
->
withColors
(
$colors
);
}
return
$query
;
}
public
function
buildSearchForm
(
AphrontFormView
$form
,
PhabricatorSavedQuery
$saved_query
)
{
$form
->
appendChild
(
id
(
new
PhabricatorFlagSelectControl
())
->
setName
(
'colors'
)
->
setLabel
(
pht
(
'Colors'
))
->
setValue
(
$saved_query
->
getParameter
(
'colors'
,
array
())));
}
protected
function
getURI
(
$path
)
{
return
'/flag/'
.
$path
;
}
public
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'Flagged'
),
);
return
$names
;
}
public
function
buildSavedQueryFromBuiltin
(
$query_key
)
{
$query
=
$this
->
newSavedQuery
();
$query
->
setQueryKey
(
$query_key
);
switch
(
$query_key
)
{
case
'all'
:
return
$query
;
}
return
parent
::
buildSavedQueryFromBuiltin
(
$query_key
);
}
}
Event Timeline
Log In to Comment