PHP Интерфейс Fuel\Validation\ResultInterface

С версии: 2.0
Автор: Fuel Development Team
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
getError ( string $field ) : string Gets an error message for the given field. Will return null if there is no message.
getErrors ( ) : string[] Returns a list of all validation errors.
getFailedRules ( ) : Fuel\Validation\RuleInterface[] Returns a list of rules that caused fields to fail, indexed by the field name.
getValidated ( ) : string[] Returns a list of fields that where successfully validated.
isValid ( ) : boolean True if the validation passed
merge ( Fuel\Validation\ResultInterface $resultInterface, string $fieldPrefix = '' ) Merges the result from the given interface to this result.
setError ( string $field, string $message, string $rule ) Sets the message for a given field.
setResult ( boolean $isValid ) Sets a true false flag for if the validation result is successful or not.
setValidated ( string $field ) Sets the name of a field that has passed validation

Описание методов

getError() публичный Метод

Gets an error message for the given field. Will return null if there is no message.
С версии: 2.0
public getError ( string $field ) : string
$field string
Результат string

getErrors() публичный Метод

Returns a list of all validation errors.
С версии: 2.0
public getErrors ( ) : string[]
Результат string[]

getFailedRules() публичный Метод

Returns a list of rules that caused fields to fail, indexed by the field name.
С версии: 2.0
public getFailedRules ( ) : Fuel\Validation\RuleInterface[]
Результат Fuel\Validation\RuleInterface[]

getValidated() публичный Метод

Returns a list of fields that where successfully validated.
С версии: 2.0
public getValidated ( ) : string[]
Результат string[]

isValid() публичный Метод

True if the validation passed
С версии: 2.0
public isValid ( ) : boolean
Результат boolean

merge() публичный Метод

Merges the result from the given interface to this result.
public merge ( Fuel\Validation\ResultInterface $resultInterface, string $fieldPrefix = '' )
$resultInterface Fuel\Validation\ResultInterface
$fieldPrefix string Prefix to be added to any field names.

setError() публичный Метод

Sets the message for a given field.
С версии: 2.0
public setError ( string $field, string $message, string $rule )
$field string
$message string
$rule string

setResult() публичный Метод

Sets a true false flag for if the validation result is successful or not.
С версии: 2.0
public setResult ( boolean $isValid )
$isValid boolean

setValidated() публичный Метод

Sets the name of a field that has passed validation
С версии: 2.0
public setValidated ( string $field )
$field string