Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Db_Table_Rowset_Abstract Class Reference

Public Member Functions

 __construct (array $config)
 Constructor.
 
 __sleep ()
 Store data, class names, and state in serialized object.
 
 __wakeup ()
 Setup to do on wakeup.
 
 init ()
 Initialize object.
 
 isConnected ()
 Return the connected state of the rowset.
 
 getTable ()
 Returns the table object, or null if this is disconnected rowset.
 
 setTable (Zend_Db_Table_Abstract $table)
 Set the table object, to re-establish a live connection to the database for a Rowset that has been de-serialized.
 
 getTableClass ()
 Query the class name of the Table object for which this Rowset was created.
 
 rewind ()
 Rewind the Iterator to the first element.
 
 current ()
 Return the current element.
 
 key ()
 Return the identifying key of the current element.
 
 next ()
 Move forward to next element.
 
 valid ()
 Check if there is a current element after calls to rewind() or next().
 
 count ()
 Returns the number of elements in the collection.
 
 seek ($position)
 Take the Iterator to position $position Required by interface SeekableIterator.
 
 offsetExists ($offset)
 Check if an offset exists Required by the ArrayAccess implementation.
 
 offsetGet ($offset)
 Get the row for the given offset Required by the ArrayAccess implementation.
 
 offsetSet ($offset, $value)
 Does nothing Required by the ArrayAccess implementation.
 
 offsetUnset ($offset)
 Does nothing Required by the ArrayAccess implementation.
 
 getRow ($position, $seek=false)
 Returns a Zend_Db_Table_Row from a known position into the Iterator.
 
 toArray ()
 Returns all data as an array.
 

Protected Member Functions

 _loadAndReturnRow ($position)
 

Protected Attributes

 $_data = array()
 
 $_table
 
 $_connected = true
 
 $_tableClass
 
 $_rowClass = 'Zend_Db_Table_Row'
 
 $_pointer = 0
 
 $_count
 
 $_rows = array()
 
 $_stored = false
 
 $_readOnly = false
 

Constructor & Destructor Documentation

__construct ( array  $config)

Constructor.

Parameters
array$config

Member Function Documentation

__sleep ( )

Store data, class names, and state in serialized object.

Returns
array
__wakeup ( )

Setup to do on wakeup.

A de-serialized Rowset should not be assumed to have access to a live database connection, so set _connected = false.

Returns
void
_loadAndReturnRow (   $position)
protected
count ( )

Returns the number of elements in the collection.

Implements Countable::count()

Returns
int
current ( )

Return the current element.

Similar to the current() function for arrays in PHP Required by interface Iterator.

Returns
Zend_Db_Table_Row_Abstract current element from the collection
getRow (   $position,
  $seek = false 
)

Returns a Zend_Db_Table_Row from a known position into the Iterator.

Parameters
int$positionthe position of the row expected
bool$seekwether or not seek the iterator to that position after
Returns
Zend_Db_Table_Row
Exceptions
Zend_Db_Table_Rowset_Exception
getTable ( )

Returns the table object, or null if this is disconnected rowset.

Returns
Zend_Db_Table_Abstract
getTableClass ( )

Query the class name of the Table object for which this Rowset was created.

Returns
string
init ( )

Initialize object.

Called from __construct() as final step of object instantiation.

Returns
void
isConnected ( )

Return the connected state of the rowset.

Returns
boolean
key ( )

Return the identifying key of the current element.

Similar to the key() function for arrays in PHP. Required by interface Iterator.

Returns
int
next ( )

Move forward to next element.

Similar to the next() function for arrays in PHP. Required by interface Iterator.

Returns
void
offsetExists (   $offset)

Check if an offset exists Required by the ArrayAccess implementation.

Parameters
string$offset
Returns
boolean
offsetGet (   $offset)

Get the row for the given offset Required by the ArrayAccess implementation.

Parameters
string$offset
Returns
Zend_Db_Table_Row_Abstract
offsetSet (   $offset,
  $value 
)

Does nothing Required by the ArrayAccess implementation.

Parameters
string$offset
mixed$value
offsetUnset (   $offset)

Does nothing Required by the ArrayAccess implementation.

Parameters
string$offset
rewind ( )

Rewind the Iterator to the first element.

Similar to the reset() function for arrays in PHP. Required by interface Iterator.

Returns
Zend_Db_Table_Rowset_Abstract Fluent interface.
seek (   $position)

Take the Iterator to position $position Required by interface SeekableIterator.

Parameters
int$positionthe position to seek to
Returns
Zend_Db_Table_Rowset_Abstract
Exceptions
Zend_Db_Table_Rowset_Exception
setTable ( Zend_Db_Table_Abstract  $table)

Set the table object, to re-establish a live connection to the database for a Rowset that has been de-serialized.

Parameters
Zend_Db_Table_Abstract$table
Returns
boolean
Exceptions
Zend_Db_Table_Row_Exception
toArray ( )

Returns all data as an array.

Updates the $_data property with current row object values.

Returns
array
valid ( )

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

Used to check if we've iterated to the end of the collection. Required by interface Iterator.

Returns
bool False if there's nothing more to iterate over

Member Data Documentation

$_connected = true
protected
$_count
protected
$_data = array()
protected
$_pointer = 0
protected
$_readOnly = false
protected
$_rowClass = 'Zend_Db_Table_Row'
protected
$_rows = array()
protected
$_stored = false
protected
$_table
protected
$_tableClass
protected