Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93620666
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
Sat, Nov 30, 05:24
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 05:24 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22677821
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