0 follower

Final Class Yiisoft\Hydrator\Attribute\Parameter\Data

InheritanceYiisoft\Hydrator\Attribute\Parameter\Data
ImplementsYiisoft\Hydrator\Attribute\Parameter\ParameterAttributeInterface, Yiisoft\Hydrator\Attribute\Parameter\ParameterAttributeResolverInterface

Resolve value from the data array used for object hydration by key specified.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $name )
$name string

                public function __construct(
    private string $name,
) {
}

            
getParameterValue() public method

public Yiisoft\Hydrator\Result getParameterValue ( Yiisoft\Hydrator\Attribute\Parameter\ParameterAttributeInterface $attribute, Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext $context )
$attribute Yiisoft\Hydrator\Attribute\Parameter\ParameterAttributeInterface
$context Yiisoft\Hydrator\AttributeHandling\ParameterAttributeResolveContext

                public function getParameterValue(
    ParameterAttributeInterface $attribute,
    ParameterAttributeResolveContext $context
): Result {
    if (!$attribute instanceof self) {
        throw new UnexpectedAttributeException(self::class, $attribute);
    }
    return $context->getData()->getValue($this->name);
}

            
getResolver() public method

public self getResolver ( )

                public function getResolver(): self
{
    return $this;
}