Interface Yiisoft\Validator\CountableLimitInterface
| Implemented by | Yiisoft\Validator\Rule\Count, Yiisoft\Validator\Rule\Length |
|---|
An optional interface for rules to implement. Rules implementing it must have minimum and maximum limits and also "exactly" value for strict equality. Boundaries must reflect numbers of countable items.
The package ships with {@see \Yiisoft\Validator\CountableLimitTrait} which already implements that interface. All you have to do is to include it in the rule class along with the interface.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getExactly() | Returns current "exactly" value meant for strict comparison. It is a shortcut for the case when {@see getMin()} and {@see getMax()} have the same not null value. | Yiisoft\Validator\CountableLimitInterface |
| getGreaterThanMaxMessage() | Returns message used when a validated value is greater than maximum in {@see getMax()}. | Yiisoft\Validator\CountableLimitInterface |
| getLessThanMinMessage() | Returns message used when a validated value is less than minimum set in {@see getMin()}. | Yiisoft\Validator\CountableLimitInterface |
| getMax() | Returns current maximum limit. | Yiisoft\Validator\CountableLimitInterface |
| getMin() | Returns current minimum limit. | Yiisoft\Validator\CountableLimitInterface |
| getNotExactlyMessage() | Returns message used when a validated value doesn't exactly match the one set in {@see getExactly()}. | Yiisoft\Validator\CountableLimitInterface |
Method Details
Returns current "exactly" value meant for strict comparison. It is a shortcut for the case when {@see getMin()} and {@see getMax()} have the same not null value.
See also getNotExactlyMessage() for related error message.
| public abstract integer|null getExactly ( ) | ||
| return | integer|null |
A number representing "exactly" value. |
|---|---|---|
public function getExactly(): ?int;
Returns message used when a validated value is greater than maximum in {@see getMax()}.
| public abstract string getGreaterThanMaxMessage ( ) | ||
| return | string |
Validation error message. |
|---|---|---|
public function getGreaterThanMaxMessage(): string;
Returns message used when a validated value is less than minimum set in {@see getMin()}.
| public abstract string getLessThanMinMessage ( ) | ||
| return | string |
Validation error message. |
|---|---|---|
public function getLessThanMinMessage(): string;
Returns current maximum limit.
See also getGreaterThanMaxMessage() for related error message.
| public abstract integer|null getMax ( ) | ||
| return | integer|null |
A number representing maximum boundary. |
|---|---|---|
public function getMax(): ?int;
Returns current minimum limit.
See also getLessThanMinMessage() for related error message.
| public abstract integer|null getMin ( ) | ||
| return | integer|null |
A number representing minimum boundary. |
|---|---|---|
public function getMin(): ?int;
Returns message used when a validated value doesn't exactly match the one set in {@see getExactly()}.
| public abstract string getNotExactlyMessage ( ) | ||
| return | string |
Validation error message. |
|---|---|---|
public function getNotExactlyMessage(): string;
Signup or Login in order to comment.