Interface Yiisoft\Validator\SkipOnErrorInterface
An optional interface for rules to implement. It allows skipping validation for a rule within a group of other rules if a previous rule (not the current one!) did not pass the validation.
The package ships with {@see \Yiisoft\Validator\Rule\Trait\SkipOnErrorTrait} which already implements that interface. All you have to do is include it in the rule class along with the interface.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| shouldSkipOnError() | Returns current "skip on error" value. | Yiisoft\Validator\SkipOnErrorInterface |
| skipOnError() | Changes current "skip on error" value. Must be immutable. | Yiisoft\Validator\SkipOnErrorInterface |
Method Details
Returns current "skip on error" value.
| public abstract boolean shouldSkipOnError ( ) | ||
| return | boolean |
Current value. |
|---|---|---|
public function shouldSkipOnError(): bool;
Changes current "skip on error" value. Must be immutable.
| public abstract $this skipOnError ( boolean $value ) | ||
| $value | boolean |
A new value. |
| return | $this |
The new instance of a rule with a changed value. |
|---|---|---|
public function skipOnError(bool $value): static;
Signup or Login in order to comment.