Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106103038
PaginationIterator.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, Mar 22, 11:04
Size
623 B
Mime Type
text/x-php
Expires
Mon, Mar 24, 11:04 (2 d)
Engine
blob
Format
Raw Data
Handle
25114137
Attached To
rPH Phabricator
PaginationIterator.php
View Options
<?php
namespace
RESTful
;
class
PaginationIterator
implements
\Iterator
{
public
function
__construct
(
$resource
,
$uri
,
$data
=
null
)
{
$this
->
_page
=
new
Page
(
$resource
,
$uri
,
$data
);
}
// Iterator
public
function
current
()
{
return
$this
->
_page
;
}
public
function
key
()
{
return
$this
->
_page
->
index
;
}
public
function
next
()
{
$this
->
_page
=
$this
->
_page
->
next
();
}
public
function
rewind
()
{
$this
->
_page
=
$this
->
_page
->
first
();
}
public
function
valid
()
{
return
$this
->
_page
!=
null
;
}
}
Event Timeline
Log In to Comment