0 follower

Final Class Yiisoft\FormModel\Attribute\Safe

InheritanceYiisoft\FormModel\Attribute\Safe
ImplementsYiisoft\Validator\RuleHandlerInterface, Yiisoft\Validator\RuleInterface

Safe validation rule marks a model property as safe for filling with FormHydrator::populate(), FormHydrator::populateAndValidate(), FormHydrator::populateFromPost(), and FormHydrator::populateFromPostAndValidate().

Method Details

Hide inherited methods

getHandler() public method

public getHandler( ): \Yiisoft\Validator\RuleHandlerInterface

                public function getHandler(): RuleHandlerInterface
{
    return $this;
}

            
getName() public method

public getName( ): string

                public function getName(): string
{
    return self::class;
}

            
validate() public method

public validate( mixed $value, object $rule, \Yiisoft\Validator\ValidationContext $context ): \Yiisoft\Validator\Result
$value mixed
$rule object
$context \Yiisoft\Validator\ValidationContext

                public function validate(mixed $value, object $rule, ValidationContext $context): Result
{
    return new Result();
}