Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93613457
NuanceQueueSearchEngine.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 30, 04:13
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 04:13 (2 d)
Engine
blob
Format
Raw Data
Handle
22661324
Attached To
rPH Phabricator
NuanceQueueSearchEngine.php
View Options
<?php
final
class
NuanceQueueSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getApplicationClassName
()
{
return
'PhabricatorNuanceApplication'
;
}
public
function
getResultTypeDescription
()
{
return
pht
(
'Nuance Queues'
);
}
public
function
newQuery
()
{
return
new
NuanceQueueQuery
();
}
protected
function
buildQueryFromParameters
(
array
$map
)
{
$query
=
$this
->
newQuery
();
return
$query
;
}
protected
function
buildCustomSearchFields
()
{
return
array
();
}
protected
function
getURI
(
$path
)
{
return
'/nuance/queue/'
.
$path
;
}
protected
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'All Queues'
),
);
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
);
}
protected
function
renderResultList
(
array
$queues
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
assert_instances_of
(
$queues
,
'NuanceQueue'
);
$viewer
=
$this
->
requireViewer
();
$list
=
new
PHUIObjectItemListView
();
$list
->
setUser
(
$viewer
);
foreach
(
$queues
as
$queue
)
{
$item
=
id
(
new
PHUIObjectItemView
())
->
setObjectName
(
pht
(
'Queue %d'
,
$queue
->
getID
()))
->
setHeader
(
$queue
->
getName
())
->
setHref
(
$queue
->
getURI
());
$list
->
addItem
(
$item
);
}
$result
=
new
PhabricatorApplicationSearchResultView
();
$result
->
setObjectList
(
$list
);
$result
->
setNoDataString
(
pht
(
'No queues found.'
));
return
$result
;
}
}
Event Timeline
Log In to Comment