Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F107088732
PhabricatorQueryIterator.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, Apr 4, 11:04
Size
901 B
Mime Type
text/x-php
Expires
Sun, Apr 6, 11:04 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25322339
Attached To
rPH Phabricator
PhabricatorQueryIterator.php
View Options
<?php
final
class
PhabricatorQueryIterator
extends
PhutilBufferedIterator
{
private
$query
;
private
$pager
;
public
function
__construct
(
PhabricatorCursorPagedPolicyAwareQuery
$query
)
{
$this
->
query
=
$query
;
}
protected
function
didRewind
()
{
$this
->
pager
=
new
AphrontCursorPagerView
();
}
public
function
key
()
{
return
$this
->
current
()->
getID
();
}
protected
function
loadPage
()
{
if
(!
$this
->
pager
)
{
return
array
();
}
$pager
=
clone
$this
->
pager
;
$query
=
clone
$this
->
query
;
$results
=
$query
->
executeWithCursorPager
(
$pager
);
// If we got less than a full page of results, this was the last set of
// results. Throw away the pager so we end iteration.
if
(!
$pager
->
getHasMoreResults
())
{
$this
->
pager
=
null
;
}
else
{
$this
->
pager
->
setAfterID
(
$pager
->
getNextPageID
());
}
return
$results
;
}
}
Event Timeline
Log In to Comment