MaxLength
in package
implements
ValueValidateInterface
文字列の最大文字数をバリデーションするクラス
Table of Contents
Interfaces
Properties
- $length : int
- $messageFormat : string
Methods
- __construct() : mixed
- 新しいインスタンスを構築します
- execute() : ValidateResult
- バリデーションを実行します
Properties
$length
protected
int
$length
$messageFormat
protected
string
$messageFormat
= 'Invalid value. Please specify with a character string of %s characters or less.'
Methods
__construct()
新しいインスタンスを構築します
public
__construct(int $length) : mixed
Parameters
- $length : int
-
最大文字数を指定します
execute()
バリデーションを実行します
public
execute(mixed $value, ValidateResult $result) : ValidateResult
Parameters
- $value : mixed
-
バリデーション対象の値を渡します
- $result : ValidateResult
-
バリデーション結果を格納するインスタンスを渡します
Return values
ValidateResult —バリデーション結果を返します