Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81583042
ConpherenceThreadSearchController.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
Fri, Sep 6, 21:20
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Sep 8, 21:20 (2 d)
Engine
blob
Format
Raw Data
Handle
20597447
Attached To
rPH Phabricator
ConpherenceThreadSearchController.php
View Options
<?php
final
class
ConpherenceThreadSearchController
extends
ConpherenceController
{
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$conpherence_id
=
$request
->
getURIData
(
'id'
);
$fulltext
=
$request
->
getStr
(
'fulltext'
);
$conpherence
=
id
(
new
ConpherenceThreadQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$conpherence_id
))
->
executeOne
();
if
(!
$conpherence
)
{
return
new
Aphront404Response
();
}
$engine
=
new
ConpherenceThreadSearchEngine
();
$engine
->
setViewer
(
$viewer
);
$saved
=
$engine
->
buildSavedQueryFromBuiltin
(
'all'
)
->
setParameter
(
'phids'
,
array
(
$conpherence
->
getPHID
()))
->
setParameter
(
'fulltext'
,
$fulltext
);
$pager
=
$engine
->
newPagerForSavedQuery
(
$saved
);
$pager
->
setPageSize
(
15
);
$query
=
$engine
->
buildQueryFromSavedQuery
(
$saved
);
$results
=
$engine
->
executeQuery
(
$query
,
$pager
);
$view
=
$engine
->
renderResults
(
$results
,
$saved
);
return
id
(
new
AphrontAjaxResponse
())
->
setContent
(
$view
->
getContent
());
}
}
Event Timeline
Log In to Comment