Class DibiResultIterator


External result set iterator.

This can be returned by DibiResult::getIterator() method or using foreach

  1. 1:  $result dibi::query('SELECT * FROM table');
  2. 2:  foreach ($result as $row{
  3. 3:     print_r($row);
  4. 4:  }
  5. 5:  unset($result);


Implements interfaces:

Iterator (internal interface), Countable (internal interface)
Copyright: Copyright (c) 2005, 2010 David Grudl
Located: in /libs/DibiResultIterator.php (line 30)
Constructor Summary
public
__construct (DibiResult $result)
Method Summary
int
count ()
Required by the Countable interface.
mixed
current ()
Returns the current element.
mixed
key ()
Returns the key of the current element.
void
next ()
Moves forward to next element.
void
rewind ()
Rewinds the iterator to the first element.
bool
valid ()
Checks if there is a current element after calls to rewind() or next().

Constructor Details

line 45

__construct

public __construct (DibiResult $result)

Input
DibiResult $result
Method Details

line 114

count

public int count ()

Required by the Countable interface.

Implementation of:

Countable::count
Output
int  

line 80

current

public mixed current ()

Returns the current element.

Implementation of:

Iterator::current
Output
mixed  

line 69

key

public mixed key ()

Returns the key of the current element.

Implementation of:

Iterator::key
Output
mixed  

line 91

next

public void next ()

Moves forward to next element.

Implementation of:

Iterator::next
Output
void  

line 56

rewind

public void rewind ()

Rewinds the iterator to the first element.

Implementation of:

Iterator::rewind
Output
void  

line 103

valid

public bool valid ()

Checks if there is a current element after calls to rewind() or next().

Implementation of:

Iterator::valid
Output
bool