ArrayHydrator
class ArrayHydrator extends AbstractHydrator (View source)
The ArrayHydrator produces a nested array "graph" that is often (not always) interchangeable with the corresponding object graph for read-only access.
Properties
protected ResultSetMapping | $rsm | The ResultSetMapping. | from AbstractHydrator |
protected EntityManagerInterface | $em | The EntityManager instance. | from AbstractHydrator |
protected AbstractPlatform | $platform | The dbms Platform instance. | from AbstractHydrator |
protected UnitOfWork | $uow | The UnitOfWork of the associated EntityManager. | from AbstractHydrator |
protected ClassMetadata[] | $metadataCache | Local ClassMetadata cache to avoid going to the EntityManager all the time. | from AbstractHydrator |
protected mixed[][] | $cache | The cache used during row-by-row hydration. | from AbstractHydrator |
protected Statement | $stmt | The statement that provides the data to hydrate. | from AbstractHydrator |
protected mixed[] | $hints | The query hints. | from AbstractHydrator |
Methods
Initializes a new instance of a class derived from AbstractHydrator.
Initiates a row-by-row hydration.
Hydrates all rows returned by the passed statement instance at once.
Hydrates a single row returned by the current statement instance during row-by-row hydration with {@link iterate()}.
When executed in a hydrate() loop we have to clear internal state to decrease memory consumption.
Executes one-time preparation tasks, once each time hydration is started through {@link hydrateAll} or {@link iterate()}.
Executes one-time cleanup tasks at the end of a hydration that was initiated through {@link hydrateAll} or {@link iterate()}.
Hydrates a single row from the current statement instance.
Hydrates all rows from the current statement instance at once.
Processes a row of the result set.
Retrieve column information from ResultSetMapping.
Retrieve ClassMetadata associated to entity class name.
Details
in AbstractHydrator at line 87
__construct(EntityManagerInterface $em)
Initializes a new instance of a class derived from AbstractHydrator.
in AbstractHydrator at line 103
IterableResult
iterate(object $stmt, object $resultSetMapping, array $hints = [])
Initiates a row-by-row hydration.
in AbstractHydrator at line 127
mixed[]
hydrateAll(object $stmt, object $resultSetMapping, array $hints = [])
Hydrates all rows returned by the passed statement instance at once.
in AbstractHydrator at line 150
mixed
hydrateRow()
Hydrates a single row returned by the current statement instance during row-by-row hydration with {@link iterate()}.
in AbstractHydrator at line 173
onClear(mixed $eventArgs)
When executed in a hydrate() loop we have to clear internal state to decrease memory consumption.
at line 42
protected
prepare()
Executes one-time preparation tasks, once each time hydration is started through {@link hydrateAll} or {@link iterate()}.
in AbstractHydrator at line 189
protected
cleanup()
Executes one-time cleanup tasks at the end of a hydration that was initiated through {@link hydrateAll} or {@link iterate()}.
at line 73
protected
hydrateRowData(array $row, array $result)
Hydrates a single row from the current statement instance.
Template method.
at line 59
protected mixed[]
hydrateAllData()
Hydrates all rows from the current statement instance at once.
in AbstractHydrator at line 241
protected mixed[]
gatherRowData(array $data, array $id, array $nonemptyComponents)
Processes a row of the result set.
Used for identity-based hydration (HYDRATE_OBJECT and HYDRATE_ARRAY). Puts the elements of a result row into a new array, grouped by the dql alias they belong to. The column names in the result set are mapped to their field names during this procedure as well as any necessary conversions on the values applied. Scalar values are kept in a specific key 'scalars'.
in AbstractHydrator at line 318
protected mixed[]
gatherScalarRowData(mixed[] $data)
Processes a row of the result set.
Used for HYDRATE_SCALAR. This is a variant of _gatherRowData() that simply converts column names to field names and properly converts the values according to their types. The resulting row has the same number of elements as before.
in AbstractHydrator at line 354
protected mixed[]|null
hydrateColumnInfo(string $key)
Retrieve column information from ResultSetMapping.
in AbstractHydrator at line 457
protected ClassMetadata
getClassMetadata(string $className)
Retrieve ClassMetadata associated to entity class name.