SingleScalarHydrator
class SingleScalarHydrator extends AbstractHydrator (View source)
Hydrator that hydrates a single scalar value from the result set.
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 array | $_metadataCache | Local ClassMetadata cache to avoid going to the EntityManager all the time. | from AbstractHydrator |
protected array | $_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 array | $_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.
Register entity as managed in UnitOfWork.
Details
in AbstractHydrator at line 100
__construct(EntityManagerInterface $em)
Initializes a new instance of a class derived from AbstractHydrator.
in AbstractHydrator at line 116
IterableResult
iterate(object $stmt, object $resultSetMapping, array $hints = array())
Initiates a row-by-row hydration.
in AbstractHydrator at line 139
array
hydrateAll(object $stmt, object $resultSetMapping, array $hints = array())
Hydrates all rows returned by the passed statement instance at once.
in AbstractHydrator at line 163
mixed
hydrateRow()
Hydrates a single row returned by the current statement instance during row-by-row hydration with {@link iterate()}.
in AbstractHydrator at line 188
void
onClear(mixed $eventArgs)
When executed in a hydrate() loop we have to clear internal state to decrease memory consumption.
in AbstractHydrator at line 198
protected void
prepare()
Executes one-time preparation tasks, once each time hydration is started through {@link hydrateAll} or {@link iterate()}.
in AbstractHydrator at line 208
protected void
cleanup()
Executes one-time cleanup tasks at the end of a hydration that was initiated through {@link hydrateAll} or {@link iterate()}.
in AbstractHydrator at line 233
protected void
hydrateRowData(array $data, array $result)
Hydrates a single row from the current statement instance.
Template method.
at line 37
protected array
hydrateAllData()
Hydrates all rows from the current statement instance at once.
in AbstractHydrator at line 261
protected array
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 329
protected array
gatherScalarRowData(array $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 364
protected array|null
hydrateColumnInfo(string $key)
Retrieve column information from ResultSetMapping.
in AbstractHydrator at line 435
protected ClassMetadata
getClassMetadata(string $className)
Retrieve ClassMetadata associated to entity class name.
in AbstractHydrator at line 455
protected void
registerManaged(ClassMetadata $class, object $entity, array $data)
Register entity as managed in UnitOfWork.