| Methods |
public
|
__construct(EntityManagerInterface $em)
Initializes a new instance of a class derived from <tt>AbstractHydrator</tt>.
Initializes a new instance of a class derived from AbstractHydrator.
Parameters
| $em |
The EntityManager to use.
|
|
#
|
public
|
iterate(
Result|ResultStatement $stmt,
ResultSetMapping $resultSetMapping,
array<string, mixed> $hints = [],
): IterableResult
Initiates a row-by-row hydration.
Initiates a row-by-row hydration.
|
#
|
public
|
toIterable(
Result|ResultStatement $stmt,
ResultSetMapping $resultSetMapping,
array<string, mixed> $hints = [],
): Generator<array-key, mixed>
Initiates a row-by-row hydration.
Initiates a row-by-row hydration.
|
#
|
final
protected
|
statement(): Result
|
#
|
final
protected
|
resultSetMapping(): ResultSetMapping
|
#
|
public
|
hydrateAll(Result|ResultStatement $stmt, ResultSetMapping $resultSetMapping, array<string, string> $hints = []): mixed[]
Hydrates all rows returned by the passed statement instance at once.
Hydrates all rows returned by the passed statement instance at once.
|
#
|
public
|
hydrateRow(): mixed[]|false
Hydrates a single row returned by the current statement instance during
row-by-row hydration with {@link iterate()} or …
Hydrates a single row returned by the current statement instance during
row-by-row hydration with {@link iterate()} or {@link toIterable()}.
|
#
|
public
|
onClear(mixed $eventArgs): void
When executed in a hydrate() loop we have to clear internal state to
decrease memory consumption.
When executed in a hydrate() loop we have to clear internal state to
decrease memory consumption.
Overriden by
|
#
|
protected
|
prepare(): void
Executes one-time preparation tasks, once each time hydration is started
through {@link hydrateAll} or {@link iterate()…
Executes one-time preparation tasks, once each time hydration is started
through {@link hydrateAll} or {@link iterate()}.
Overriden by
|
#
|
protected
|
cleanup(): void
Executes one-time cleanup tasks at the end of a hydration that was initiated
through {@link hydrateAll} or {@link…
Executes one-time cleanup tasks at the end of a hydration that was initiated
through {@link hydrateAll} or {@link iterate()}.
Overriden by
|
#
|
protected
|
cleanupAfterRowIteration(): void
|
#
|
protected
|
hydrateRowData(mixed[] $row, mixed[] &$result): void
Hydrates a single row from the current statement instance.
Hydrates a single row from the current statement instance.
Template method.
Parameters
| $row |
The row data.
|
| $result |
The result to fill.
|
Throws
Overriden by
|
#
|
abstract
protected
|
hydrateAllData(): mixed[]
Hydrates all rows from the current statement instance at once.
Hydrates all rows from the current statement instance at once.
Implemented by
|
#
|
protected
|
gatherRowData(
mixed[] $data,
array<string, string> &$id,
array<string, bool> &$nonemptyComponents,
): array<string, array<string, mixed>>
Processes a row of the result set.
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'.
Parameters
| $data |
SQL Result Row.
|
| $id |
Dql-Alias => ID-Hash.
|
| $nonemptyComponents |
Does this DQL-Alias has at least one non NULL value?
|
Returns
An array with all the fields
(name => value) of the data
row, grouped by their
component alias.
|
#
|
protected
|
gatherScalarRowData(array<string, mixed> &$data): mixed[]
Processes a row of the result set.
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.
Returns
|
#
|
protected
|
hydrateColumnInfo(string $key): mixed[]|null
Retrieve column information from ResultSetMapping.
Retrieve column information from ResultSetMapping.
Parameters
|
#
|
private
|
getDiscriminatorValues(ClassMetadata $classMetadata): string[]
|
#
|
protected
|
getClassMetadata(string $className): ClassMetadata
Retrieve ClassMetadata associated to entity class name.
Retrieve ClassMetadata associated to entity class name.
|
#
|
protected
|
registerManaged(ClassMetadata $class, object $entity, mixed[] $data): void
Register entity as managed in UnitOfWork.
Register entity as managed in UnitOfWork.
|
#
|
final
protected
|
buildEnum(mixed $value, class-string<BackedEnum> $enumType): BackedEnum|array<BackedEnum>
|
#
|