Trait Yiisoft\Validator\Rule\Trait\SkipOnErrorTrait
An implementation for {@see SkipOnErrorInterface} intended to be included in rules. Requires an additional private
class property $skipOnError. In package rules it's false by default:
public function __construct(
// ...
private bool $skipOnError = false,
// ...
) {
}
Public Methods
| Method | Description | Defined By |
|---|---|---|
| shouldSkipOnError() | A getter for $skipOnError property. |
Yiisoft\Validator\Rule\Trait\SkipOnErrorTrait |
| skipOnError() | An immutable setter to change $skipOnError property. |
Yiisoft\Validator\Rule\Trait\SkipOnErrorTrait |
Method Details
A getter for $skipOnError property.
| public boolean shouldSkipOnError ( ) | ||
| return | boolean |
Current value. |
|---|---|---|
public function shouldSkipOnError(): bool
{
return $this->skipOnError;
}
An immutable setter to change $skipOnError property.
| public $this skipOnError ( boolean $value ) | ||
| $value | boolean |
A new value. |
| return | $this |
The new instance with a changed value. |
|---|---|---|
public function skipOnError(bool $value): static
{
$new = clone $this;
$new->skipOnError = $value;
return $new;
}
Signup or Login in order to comment.