LFT
  • Namespace
  • Class
  • Tree

Namespaces

  • Docoflow
    • Contracts
    • Entity
    • Facades
    • Models
    • Traits
  • Docolight
    • Agno
      • Traits
    • Container
    • Http
      • Contracts
    • Rest
      • Handler
      • Http
    • Support
      • Debug
      • Traits
  • Docotory
    • Traits
  • None

Classes

  • ActiveRecordWrapper
  • Arr
  • Carbonate
  • ClassLoader
  • Collection
  • CollectionDataProvider
  • Facade
  • Factory
  • Fluent
  • Html
  • IterablePager
  • Repository
  • Set
  • Str

Class IterablePager

Iterate your active record in a page. Usefull to make a paging report.

$model = MyModel::model()->findByPk(1);

$pager = new IterablePager($model, 20);


foreach($pager as $stack)
{ // $stack = array with 20 length, contains MyModel implementation // next loop will be the next 20 and so on until the last of your // data. it respects your criteria also.
}
Docolight\Support\IterablePager implements Iterator
Abstract
Namespace: Docolight\Support
Located at Docolight/Support/IterablePager.php

Methods summary

public
# __construct( CActiveRecord $model, integer $limit = 10 )

Class constructor.

Class constructor.

Parameters

$model
$limit
public
# rewind( )

Rewind cursor.

Rewind cursor.

Implementation of

Iterator::rewind()
public array
# current( )

Get current cursor.

Get current cursor.

Returns

array

Implementation of

Iterator::current()
public
# next( )

Fetch next page.

Fetch next page.

Implementation of

Iterator::next()
public boolean
# valid( )

Determine whether next page exists.

Determine whether next page exists.

Returns

boolean

Implementation of

Iterator::valid()
public integer
# key( )

Get current offset.

Get current offset.

Returns

integer

Implementation of

Iterator::key()
abstract protected mixed
# prepare( array $items )

Prepare the data before we store them in $current property.

Prepare the data before we store them in $current property.

Parameters

$items

Returns

mixed

Properties summary

protected integer $total

Total data.

Total data.

#
protected array $current

Current data.

Current data.

#
protected CActiveRecord $model

Model.

Model.

#
protected CDbCriteria $criteria

Criteria.

Criteria.

#
LFT API documentation generated by ApiGen