Class MinMaxOptions
Responsibility: Validate minimum or maximum selected options count in submitted value by configured field setters.
-
MvcCore\Ext\Forms\Validator
implements
MvcCore\Ext\Forms\IValidator
-
MvcCore\Ext\Forms\Validators\ValueInOptions
implements
MvcCore\Ext\Forms\Fields\IMultiple,
MvcCore\Ext\Forms\Fields\IOptions
uses
MvcCore\Ext\Forms\Field\Props\Multiple,
MvcCore\Ext\Forms\Field\Props\Options
-
MvcCore\Ext\Forms\Validators\MinMaxOptions
uses
MvcCore\Ext\Forms\Field\Props\MinMaxOptions
Methods summary
public
MvcCore\Ext\Forms\Validator
|
#
SetField( MvcCore\Ext\Forms\IField $field )
Set up field instance, where is validated value by this
validator during submit before every Validate() method call.
This method is also called once, when validator instance is separately
added into already created field instance to process any field checking.
Set up field instance, where is validated value by this
validator during submit before every Validate() method call.
This method is also called once, when validator instance is separately
added into already created field instance to process any field checking.
Parameters
Returns
Overrides
|
public
string[]|null
|
#
Validate( string|array $rawSubmittedValue )
Validate raw user input with maximum options count check.
Validate raw user input with maximum options count check.
Parameters
- $rawSubmittedValue
- Raw submitted value from user.
Returns
string[]|null Safe submitted value or NULL if not possible to return safe value.
Overrides
|
Methods used from MvcCore\Ext\Forms\Field\Props\MinMaxOptions
GetMaxOptions(),
GetMaxOptionsBubbleMessage(),
GetMinOptions(),
GetMinOptionsBubbleMessage(),
GetRequiredBubbleMessage(),
SetMaxOptions(),
SetMaxOptionsBubbleMessage(),
SetMinOptions(),
SetMinOptionsBubbleMessage(),
SetRequiredBubbleMessage(),
setFormMinMaxOptions()
|
Properties summary
protected static
array
|
$errorMessages
Validation failure message template definitions.
Validation failure message template definitions.
|
#
[
self::ERROR_MIN_OPTIONS => "Field '{0}' requires at least {1} chosen option(s) at minimum.",
self::ERROR_MAX_OPTIONS => "Field '{0}' requires {1} of the selected option(s) at maximum.",
]
|
protected static
array
|
$fieldSpecificProperties
Field specific values (camel case) and their validator default values.
Field specific values (camel case) and their validator default values.
|
#
[
'minOptions' => NULL,
'maxOptions' => NULL,
]
|