HydrateWith
Specifies the class to use when hydrating each element of an array property.
This attribute is used by the Reflection::hydrate()
method to determine the class to instantiate
for each element in an array when the property type is simply array
or the type hint lacks precision.
It is particularly useful for collections of objects where the target class cannot be inferred directly from the property type or PHPDoc.
Tags
Attributes
- #[Attribute]
- \Attribute::TARGET_PROPERTY
Table of Contents
Properties
- $classes : array<string|int, mixed>
Methods
- __construct() : mixed
Properties
$classes
public
array<string|int, mixed>
$classes
Methods
__construct()
public
__construct(mixed ...$classes) : mixed
Parameters
- $classes : mixed