Property | Type | Description | |
---|---|---|---|
$dataWrapper | Sirius\Validation\DataWrapper\WrapperInterface | The object that will contain the data | |
$errorMessagePrototype | Sirius\Validation\ErrorMessage | ||
$messages | array | ||
$ruleFactory | |||
$rules | array | ||
$wasValidated | boolean |
Method | Description | |
---|---|---|
__construct ( |
||
add ( string $selector, string | callback $name = null, string | array $options = null, string $messageTemplate = null, string $label = null ) : |
||
addMessage ( string $item, string $message = null ) : self | ||
addMultiple ( array $selectorRulesCollection ) : |
||
clearMessages ( string $item = null ) : self | Clears the messages of an item | |
getDataWrapper ( mixed $data = null ) : Sirius\Validation\DataWrapper\WrapperInterface | The data wrapper will be used to wrap around the data passed to the validator This way you can validate anything, not just arrays (which is the default) | |
getErroMessagePrototype ( ) : Sirius\Validation\ErrorMessage | Retrieve the error message prototype | |
getMessages ( string $item = null ) : array | ||
getRuleFactory ( ) : |
Retrieve the rule factory | |
getRules ( ) | ||
remove ( string $selector, mixed $name = true, mixed $options = null ) : self | ||
setData ( $data ) | ||
setErrorMessagePrototype ( Sirius\Validation\ErrorMessage $errorMessagePrototype ) : Sirius\Validation\Rule\AbstractValidator | ||
validate ( mixed $data = null ) : boolean | Performs the validation |
Method | Description | |
---|---|---|
ensureSelectorRulesExist ( string $selector, string $label = null ) |
public __construct ( |
||
$ruleFactory | ||
$errorMessagePrototype | Sirius\Validation\ErrorMessage |
public addMessage ( string $item, string $message = null ) : self | ||
$item | string | data identifier (eg: 'email', 'addresses[0][state]') |
$message | string | |
return | self |
public addMultiple ( array $selectorRulesCollection ) : |
||
$selectorRulesCollection | array | |
return |
public clearMessages ( string $item = null ) : self | ||
$item | string | |
return | self |
protected ensureSelectorRulesExist ( string $selector, string $label = null ) | ||
$selector | string | |
$label | string |
public getDataWrapper ( mixed $data = null ) : Sirius\Validation\DataWrapper\WrapperInterface | ||
$data | mixed | |
return | Sirius\Validation\DataWrapper\WrapperInterface |
public getErroMessagePrototype ( ) : Sirius\Validation\ErrorMessage | ||
return | Sirius\Validation\ErrorMessage |
public getMessages ( string $item = null ) : array | ||
$item | string | key of the messages array (eg: 'password', 'addresses[0][line_1]') |
return | array |
public getRuleFactory ( ) : |
||
return |
public setErrorMessagePrototype ( Sirius\Validation\ErrorMessage $errorMessagePrototype ) : Sirius\Validation\Rule\AbstractValidator | ||
$errorMessagePrototype | Sirius\Validation\ErrorMessage | |
return | Sirius\Validation\Rule\AbstractValidator |
protected WrapperInterface,Sirius\Validation\DataWrapper $dataWrapper | ||
return | Sirius\Validation\DataWrapper\WrapperInterface |
protected ErrorMessage,Sirius\Validation $errorMessagePrototype | ||
return | Sirius\Validation\ErrorMessage |
protected RuleFactory,Sirius\Validation $ruleFactory | ||
return |