Final Class Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext
| Inheritance | Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext |
|---|
Holds attribute resolving context data.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext | |
| getData() | Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext | |
| getHydrator() | Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext | |
| getParameter() | Get resolved parameter or property reflection. | Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext |
| getResolvedValue() | Get the resolved value. | Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext |
| isResolved() | Get whether the value for object property is resolved already. | Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext |
Method Details
| public mixed __construct ( ReflectionParameter|ReflectionProperty $parameter, Yiisoft\Hydrator\Result $resolveResult, Yiisoft\Hydrator\DataInterface $data, Yiisoft\Hydrator\HydratorInterface|null $hydrator = null ) | ||
| $parameter | ReflectionParameter|ReflectionProperty |
Resolved parameter or property reflection. |
| $resolveResult | Yiisoft\Hydrator\Result |
The resolved value object. |
| $data | Yiisoft\Hydrator\DataInterface |
Data to be used for resolving. |
| $hydrator | Yiisoft\Hydrator\HydratorInterface|null | |
public function __construct(
private ReflectionParameter|ReflectionProperty $parameter,
private Result $resolveResult,
private DataInterface $data,
private ?HydratorInterface $hydrator = null,
) {
}
| public Yiisoft\Hydrator\DataInterface getData ( ) | ||
| return | Yiisoft\Hydrator\DataInterface |
Data to be used for resolving. |
|---|---|---|
public function getData(): DataInterface
{
return $this->data;
}
| public Yiisoft\Hydrator\HydratorInterface getHydrator ( ) |
public function getHydrator(): HydratorInterface
{
if ($this->hydrator === null) {
throw new LogicException('Hydrator is not set in parameter attribute resolve context.');
}
return $this->hydrator;
}
Get resolved parameter or property reflection.
| public ReflectionParameter|ReflectionProperty getParameter ( ) | ||
| return | ReflectionParameter|ReflectionProperty |
Resolved parameter or property reflection. |
|---|---|---|
public function getParameter(): ReflectionParameter|ReflectionProperty
{
return $this->parameter;
}
Get the resolved value.
When value is not resolved returns null. But null can be is resolved value, use {@see \Yiisoft\Hydrator\AttributeHandling\isResolved()} for check
the value is resolved or not.
| public mixed getResolvedValue ( ) | ||
| return | mixed |
The resolved value. |
|---|---|---|
public function getResolvedValue(): mixed
{
return $this->resolveResult->getValue();
}
Get whether the value for object property is resolved already.
| public boolean isResolved ( ) | ||
| return | boolean |
Whether the value for object property is resolved. |
|---|---|---|
public function isResolved(): bool
{
return $this->resolveResult->isResolved();
}
Signup or Login in order to comment.