HydrateKey
Overrides the expected array key used to hydrate a property.
By default, Reflection::hydrate()
maps array keys to property names. This attribute allows
customizing that mapping, e.g., when the source data uses different naming conventions (e.g., snake_case vs camelCase),
or when the key needs to be renamed for compatibility reasons.
Tags
Attributes
- #[Attribute]
- \Attribute::TARGET_PROPERTY
Table of Contents
Properties
- $key : string
Methods
- __construct() : mixed
Properties
$key
public
string
$key
Methods
__construct()
public
__construct(string $key) : mixed
Parameters
- $key : string