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 \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 getMin() and getMax() have the same not null value. | Yiisoft\Validator\CountableLimitInterface |
| getGreaterThanMaxMessage() | Returns message used when a validated value is greater than maximum in getMax(). | Yiisoft\Validator\CountableLimitInterface |
| getLessThanMinMessage() | Returns message used when a validated value is less than minimum set in 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 getExactly(). | Yiisoft\Validator\CountableLimitInterface |
Method Details
Returns current "exactly" value meant for strict comparison. It is a shortcut for the case when getMin() and getMax() have the same not null value.
See also getNotExactlyMessage() for related error message.
| public abstract getExactly( ): integer|null | ||
| return | integer|null |
A number representing "exactly" value. |
|---|---|---|
public function getExactly(): ?int;
Returns message used when a validated value is greater than maximum in getMax().
| public abstract getGreaterThanMaxMessage( ): string | ||
| return | string |
Validation error message. |
|---|---|---|
public function getGreaterThanMaxMessage(): string;
Returns message used when a validated value is less than minimum set in getMin().
| public abstract getLessThanMinMessage( ): string | ||
| return | string |
Validation error message. |
|---|---|---|
public function getLessThanMinMessage(): string;
Returns current maximum limit.
See also getGreaterThanMaxMessage() for related error message.
| public abstract getMax( ): integer|null | ||
| 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 getMin( ): integer|null | ||
| 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 getExactly().
| public abstract getNotExactlyMessage( ): string | ||
| return | string |
Validation error message. |
|---|---|---|
public function getNotExactlyMessage(): string;
Signup or Login in order to comment.