Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893009
PhabricatorTypeaheadMonogramDatasource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorTypeaheadMonogramDatasource.php
View Options
<?php
final
class
PhabricatorTypeaheadMonogramDatasource
extends
PhabricatorTypeaheadDatasource
{
public
function
isBrowsable
(
)
{
// This source isn't meaningfully browsable. Although it's technically
// possible to let users browse through every object on an install, there
// is no use case for it and it doesn't seem worth building.
return
false
;
}
public
function
getBrowseTitle
(
)
{
return
pht
(
'Browse Objects'
)
;
}
public
function
getPlaceholderText
(
)
{
return
pht
(
'Type an object name...'
)
;
}
public
function
getDatasourceApplicationClass
(
)
{
return
null
;
}
public
function
loadResults
(
)
{
$viewer
=
$this
->
getViewer
(
)
;
$raw_query
=
$this
->
getRawQuery
(
)
;
$results
=
array
(
)
;
$objects
=
id
(
new
PhabricatorObjectQuery
(
)
)
->
setViewer
(
$viewer
)
->
withNames
(
array
(
$raw_query
)
)
->
execute
(
)
;
if
(
$objects
)
{
$handles
=
id
(
new
PhabricatorHandleQuery
(
)
)
->
setViewer
(
$viewer
)
->
withPHIDs
(
mpull
(
$objects
,
'getPHID'
)
)
->
execute
(
)
;
$handle
=
head
(
$handles
)
;
if
(
$handle
)
{
$results
[
]
=
id
(
new
PhabricatorTypeaheadResult
(
)
)
->
setName
(
$handle
->
getFullName
(
)
)
->
setDisplayType
(
$handle
->
getTypeName
(
)
)
->
setURI
(
$handle
->
getURI
(
)
)
->
setPHID
(
$handle
->
getPHID
(
)
)
->
setPriorityType
(
'jump'
)
;
}
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 17:42 (6 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127077
Default Alt Text
PhabricatorTypeaheadMonogramDatasource.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment