class Doctrine_Hydrator_ArrayDriver extends Doctrine_Hydrator_Graph (View source)

Builds result sets in to the object graph using php arrays

Properties

protected Doctrine_Locator $_locator from Doctrine_Locator_Injectable
protected array $_resources from Doctrine_Locator_Injectable
static protected Doctrine_Null $_null from Doctrine_Locator_Injectable
protected $_queryComponents from Doctrine_Hydrator_Abstract
protected $_tableAliases from Doctrine_Hydrator_Abstract
protected $_priorRow from Doctrine_Hydrator_Abstract
protected $_hydrationMode from Doctrine_Hydrator_Abstract
protected $_tables from Doctrine_Hydrator_Graph

Methods

setLocator(Doctrine_Locator $locator)

setLocator this method can be used for setting the locator object locally

getLocator()

getLocator returns the locator associated with this object

mixed
locate(string $name)

locate locates a resource by given name and returns it

bind($name, $resource)

bind binds a resource to a name

static void
initNullObject(Doctrine_Null $null)

initNullObject initializes the null object

static Doctrine_Null
getNullObject()

getNullObject returns the null object associated with this object

__construct($queryComponents = null, $tableAliases = null, $hydrationMode = null)

No description

void
setQueryComponents(array $queryComponents)

Set the query components (structure and query instructions)

void
setTableAliases(array $tableAliases)

Set the table aliases for this query

void
setHydrationMode(mixed $hydrationMode)

Set the hydration mode

onDemandReset()

No description

boolean
_isIgnoredName(string $name)

Checks whether a name is ignored. Used during result set parsing to skip certain elements in the result set that do not have any meaning for the result.

mixed
hydrateResultSet(mixed $stmt)

hydrateResultSet parses the data returned by statement object

string
_getCustomIndexField($alias)

Gets the custom field used for indexing for the specified component alias.

array
_gatherRowData($data, $cache, $id, $nonemptyComponents)

Puts the fields of a data row into a new array, grouped by the component they belong to. The column names in the result set are mapped to their field names during this procedure.

getElementCollection($component)

No description

registerCollection($coll)

No description

initRelated($record, $name, $keyColumn = null)

No description

getNullPointer()

No description

getElement(array $data, $component)

No description

getLastKey($coll)

No description

setLastElement($prev, $coll, $index, $dqlAlias, $oneToOne)

No description

flush()

No description

string
_getClassnameToReturn(array $data, $component)

Get the classname to return. Most often this is just the options['name']

Details

Doctrine_Locator_Injectable setLocator(Doctrine_Locator $locator)

setLocator this method can be used for setting the locator object locally

Parameters

Doctrine_Locator $locator the locator object

Return Value

Doctrine_Locator_Injectable this instance

Doctrine_Locator getLocator()

getLocator returns the locator associated with this object

if there are no locator locally associated then this method tries to fetch the current global locator

Return Value

Doctrine_Locator

mixed locate(string $name)

locate locates a resource by given name and returns it

if the resource cannot be found locally this method tries to use the global locator for finding the resource

Parameters

string $name the name of the resource

Return Value

mixed the located resource

Exceptions

Doctrine_Locator_Exception if the resource could not be found

See also

Doctrine_Locator::locate

Doctrine_Locator bind($name, $resource)

bind binds a resource to a name

Parameters

$name
$resource

Return Value

Doctrine_Locator this object

static void initNullObject(Doctrine_Null $null)

initNullObject initializes the null object

Parameters

Doctrine_Null $null

Return Value

void

static Doctrine_Null getNullObject()

getNullObject returns the null object associated with this object

Return Value

Doctrine_Null

__construct($queryComponents = null, $tableAliases = null, $hydrationMode = null)

Parameters

$queryComponents
$tableAliases
$hydrationMode

void setQueryComponents(array $queryComponents)

Set the query components (structure and query instructions)

Parameters

array $queryComponents

Return Value

void

void setTableAliases(array $tableAliases)

Set the table aliases for this query

Parameters

array $tableAliases

Return Value

void

void setHydrationMode(mixed $hydrationMode)

Set the hydration mode

Parameters

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

Return Value

void

getRootComponent()

onDemandReset()

protected boolean _isIgnoredName(string $name)

Checks whether a name is ignored. Used during result set parsing to skip certain elements in the result set that do not have any meaning for the result.

(I.e. ORACLE limit/offset emulation adds doctrine_rownum to the result set).

Parameters

string $name

Return Value

boolean

mixed hydrateResultSet(mixed $stmt)

hydrateResultSet parses the data returned by statement object

This is method defines the core of Doctrine object population algorithm hence this method strives to be as fast as possible

The key idea is the loop over the rowset only once doing all the needed operations within this massive loop.

Parameters

mixed $stmt

Return Value

mixed

protected string _getCustomIndexField($alias)

Gets the custom field used for indexing for the specified component alias.

Parameters

$alias

Return Value

string The field name of the field used for indexing or NULL if the component does not use any custom field indices.

protected array _gatherRowData($data, $cache, $id, $nonemptyComponents)

Puts the fields of a data row into a new array, grouped by the component they belong to. The column names in the result set are mapped to their field names during this procedure.

Parameters

$data
$cache
$id
$nonemptyComponents

Return Value

array An array with all the fields (name => value) of the data row, grouped by their component (alias).

getElementCollection($component)

Parameters

$component

registerCollection($coll)

Parameters

$coll

initRelated($record, $name, $keyColumn = null)

Parameters

$record
$name
$keyColumn

getNullPointer()

getElement(array $data, $component)

Parameters

array $data
$component

getLastKey($coll)

Parameters

$coll

setLastElement($prev, $coll, $index, $dqlAlias, $oneToOne)

Parameters

$prev
$coll
$index
$dqlAlias
$oneToOne

protected string _getClassnameToReturn(array $data, $component)

Get the classname to return. Most often this is just the options['name']

Check the subclasses option and the inheritanceMap for each subclass to see if all the maps in a subclass is met. If this is the case return that subclass name. If no subclasses match or if there are no subclasses defined return the name of the class for this tables record.

Parameters

array $data
$component

Return Value

string The name of the class to create