Final Class Yiisoft\Hydrator\ObjectMap
| Inheritance | Yiisoft\Hydrator\ObjectMap |
|---|
Provides a mapping of object property names to keys in the data array.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $map | array | Yiisoft\Hydrator\ObjectMap |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Hydrator\ObjectMap | |
| exists() | Checks if a given property name exists in the mapping array. | Yiisoft\Hydrator\ObjectMap |
| getNames() | Returns a list of property names for which mapping is set. | Yiisoft\Hydrator\ObjectMap |
| getPath() | Returns a path for a given property name or null if mapping dosen't exist. | Yiisoft\Hydrator\ObjectMap |
Property Details
Method Details
| public mixed __construct ( array $map ) | ||
| $map | array |
Object property names mapped to keys in the data array that hydrator will use when hydrating an object. |
public function __construct(
public readonly array $map
) {
}
Checks if a given property name exists in the mapping array.
| public boolean exists ( string $name ) | ||
| $name | string |
The property name. |
| return | boolean |
Whether the property name exists in the mapping array. |
|---|---|---|
public function exists(string $name): bool
{
return array_key_exists($name, $this->map);
}
Signup or Login in order to comment.