Doctrine 1.2.4
Doctrine_Hydrator Class Reference

Public Member Functions

 getHydrationMode ()
 
 getHydratorDriver ($mode, $tableAliases)
 
 getHydratorDriverClassName ($mode=null)
 
 getQueryComponents ()
 
 hydrateResultSet ($stmt, $tableAliases)
 
 setHydrationMode ($hydrationMode)
 
 setQueryComponents (array $queryComponents)
 

Detailed Description

Definition at line 35 of file Hydrator.php.

Member Function Documentation

Doctrine_Hydrator::getHydrationMode ( )

Get the hydration mode

Returns
mixed $hydrationMode One of the Doctrine_Core::HYDRATE_* constants

Definition at line 68 of file Hydrator.php.

{
return $this->_hydrationMode;
}
Doctrine_Hydrator::getHydratorDriver (   $mode,
  $tableAliases 
)

Get an instance of the hydration driver for the passed hydration mode

Parameters
string$mode
array$tableAliases
Returns
object Doctrine_Hydrator_Abstract

Definition at line 119 of file Hydrator.php.

{
$driverClass = $this->getHydratorDriverClassName($mode);
if (is_object($driverClass)) {
if (!$driverClass instanceOf Doctrine_Hydrator_Abstract) {
throw new Doctrine_Hydrator_Exception('Invalid hydration class specified: '.get_class($driverClass));
}
$driver = $driverClass;
$driver->setQueryComponents($this->_queryComponents);
$driver->setTableAliases($tableAliases);
$driver->setHydrationMode($mode);
} else {
$driver = new $driverClass($this->_queryComponents, $tableAliases, $mode);
}
return $driver;
}
Doctrine_Hydrator::getHydratorDriverClassName (   $mode = null)

Get the name of the driver class for the passed hydration mode

Parameters
string$mode
Returns
string $className

Definition at line 99 of file Hydrator.php.

{
if ($mode === null) {
$mode = $this->_hydrationMode;
}
if ( ! isset($this->_hydrators[$mode])) {
throw new Doctrine_Hydrator_Exception('Invalid hydration mode specified: '.$this->_hydrationMode);
}
return $this->_hydrators[$mode];
}
Doctrine_Hydrator::getQueryComponents ( )

Get the array of query components

Returns
array $queryComponents

Definition at line 88 of file Hydrator.php.

{
return $this->_queryComponents;
}
Doctrine_Hydrator::hydrateResultSet (   $stmt,
  $tableAliases 
)

Hydrate the query statement in to its final data structure by one of the hydration drivers.

Parameters
object$stmt
array$tableAliases
Returns
mixed $result

Definition at line 145 of file Hydrator.php.

{
$driver = $this->getHydratorDriver($this->_hydrationMode, $tableAliases);
$result = $driver->hydrateResultSet($stmt);
return $result;
}
Doctrine_Hydrator::setHydrationMode (   $hydrationMode)

Set the hydration mode

Parameters
mixed$hydrationModeOne of the Doctrine_Core::HYDRATE_* constants or a string representing the name of the hydration mode or or an instance of the hydration class

Definition at line 58 of file Hydrator.php.

{
$this->_hydrationMode = $hydrationMode;
}
Doctrine_Hydrator::setQueryComponents ( array  $queryComponents)

Set the array of query components

Parameters
array$queryComponents

Definition at line 78 of file Hydrator.php.

{
$this->_queryComponents = $queryComponents;
}

The documentation for this class was generated from the following file: