Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72593211
DivinerBookDatasource.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
Tue, Jul 16, 01:16
Size
876 B
Mime Type
text/x-php
Expires
Thu, Jul 18, 01:16 (2 d)
Engine
blob
Format
Raw Data
Handle
19069554
Attached To
rPH Phabricator
DivinerBookDatasource.php
View Options
<?php
final
class
DivinerBookDatasource
extends
PhabricatorTypeaheadDatasource
{
public
function
getBrowseTitle
()
{
return
pht
(
'Browse Books'
);
}
public
function
getPlaceholderText
()
{
return
pht
(
'Type a book name...'
);
}
public
function
getDatasourceApplicationClass
()
{
return
'PhabricatorDivinerApplication'
;
}
public
function
loadResults
()
{
$raw_query
=
$this
->
getRawQuery
();
$query
=
id
(
new
DivinerBookQuery
())
->
setOrder
(
'name'
)
->
withNamePrefix
(
$raw_query
);
$books
=
$this
->
executeQuery
(
$query
);
$results
=
array
();
foreach
(
$books
as
$book
)
{
$results
[]
=
id
(
new
PhabricatorTypeaheadResult
())
->
setName
(
$book
->
getTitle
())
->
setURI
(
'/book/'
.
$book
->
getName
().
'/'
)
->
setPHID
(
$book
->
getPHID
())
->
setPriorityString
(
$book
->
getName
());
}
return
$results
;
}
}
Event Timeline
Log In to Comment