Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
HydratingResultSet Class Reference

Public Member Functions

 __construct (HydratorInterface $hydrator=null, $objectPrototype=null)
 Constructor.
 
 setObjectPrototype ($objectPrototype)
 Set the row object prototype.
 
 getObjectPrototype ()
 Get the row object prototype.
 
 setHydrator (HydratorInterface $hydrator)
 Set the hydrator to use for each row object.
 
 getHydrator ()
 Get the hydrator to use for each row object.
 
 current ()
 Iterator: get current item.
 
 toArray ()
 Cast result set to array of arrays.
 
- Public Member Functions inherited from AbstractResultSet
 initialize ($dataSource)
 Set the data source for the result set.
 
 buffer ()
 
 isBuffered ()
 
 getDataSource ()
 Get the data source used to create the result set.
 
 getFieldCount ()
 Retrieve count of fields in individual rows of the result set.
 
 next ()
 Iterator: move pointer to next item.
 
 key ()
 Iterator: retrieve current key.
 
 current ()
 Iterator: get current item.
 
 valid ()
 Iterator: is pointer valid?
 
 rewind ()
 Iterator: rewind.
 
 count ()
 Countable: return count of rows.
 
 toArray ()
 Cast result set to array of arrays.
 

Protected Attributes

 $hydrator = null
 
 $objectPrototype = null
 
- Protected Attributes inherited from AbstractResultSet
 $buffer = null
 
 $count = null
 
 $dataSource = null
 
 $fieldCount = null
 
 $position = 0
 

Constructor & Destructor Documentation

__construct ( HydratorInterface  $hydrator = null,
  $objectPrototype = null 
)

Constructor.

Parameters
null | HydratorInterface$hydrator
null | object$objectPrototype

Member Function Documentation

current ( )

Iterator: get current item.

Returns
object
getHydrator ( )

Get the hydrator to use for each row object.

Returns
HydratorInterface
getObjectPrototype ( )

Get the row object prototype.

Returns
object
setHydrator ( HydratorInterface  $hydrator)

Set the hydrator to use for each row object.

Parameters
HydratorInterface$hydrator
Returns
HydratingResultSet
setObjectPrototype (   $objectPrototype)

Set the row object prototype.

Parameters
object$objectPrototype
Exceptions
Exception\InvalidArgumentException
Returns
ResultSet
toArray ( )

Cast result set to array of arrays.

Returns
array
Exceptions
Exception\RuntimeExceptionif any row is not castable to an array

Member Data Documentation

$hydrator = null
protected
$objectPrototype = null
protected