class Doctrine_Hydrator_ArrayShallowDriver extends Doctrine_Hydrator_ScalarDriver (View source)

Extended version of Doctrine_Hydrator_ScalarDriver, passes its _gatherRowData function a value of false for $aliasPrefix in order to cause it to generate the sorts of array keys one would see in a HYDRATE_ARRAY type return.

Note: This hydrator will have issues with fields in the return that have the same name (such as 2 fields each called id) -- the second field value will overwrite the first field.

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

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

_gatherRowData($data, $cache, $aliasPrefix = true)

No description

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 _gatherRowData($data, $cache, $aliasPrefix = true)

Parameters

$data
$cache
$aliasPrefix