Interface Yiisoft\Validator\WhenInterface
An optional interface for rules to implement. It allows applying validation for a rule within a group of other rules under certain conditions.
The package ships with {@see \
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getWhen() | Returns current "when" value. | Yiisoft\ |
| when() | Changes current "when" value. Must be immutable. | Yiisoft\ |
Method Details
Returns current "when" value.
| public abstract ?\ |
public function getWhen(): ?Closure;
Changes current "when" value. Must be immutable.
See also Yiisoft\
| public abstract $this when ( ?\ | ||
| $value | ?\ |
|
| return | $this |
The new instance of a rule with a changed value. |
|---|---|---|
public function when(?Closure $value): static;
User Contributed Notes
Leave a comment
Join the conversation to share a note.