PHP Class Fuel\Validation\Result

Since: 2.0
Author: Fuel Development Team
Inheritance: implements Fuel\Validation\ResultInterface
Afficher le fichier Open project: fuelphp/validation Class Usage Examples

Protected Properties

Свойство Type Description
$errors string[] Contains an array of errors that occurred during validation
$failedRules Fuel\Validation\RuleInterface[] Contains the rule that caused a given field to fail
$result boolean Boolean flag to indicate overall failure or success
$validated string[] Contains a list of fields that passed validation

Méthodes publiques

Méthode Description
getError ( string $field ) : string
getErrors ( ) : string[]
getFailedRules ( ) : Fuel\Validation\RuleInterface[] Returns a list of rules that caused fields to fail, indexed by the field name.
getValidated ( ) : string[]
isValid ( ) : boolean
merge ( Fuel\Validation\ResultInterface $resultInterface, $fieldPrefix = '' )
setError ( string $field, string $message, string $rule ) Sets the error message for the given field
setResult ( boolean $isValid )
setValidated ( string $field )

Method Details

getError() public méthode

Since: 2.0
public getError ( string $field ) : string
$field string
Résultat string

getErrors() public méthode

Since: 2.0
public getErrors ( ) : string[]
Résultat string[]

getFailedRules() public méthode

Returns a list of rules that caused fields to fail, indexed by the field name.
Since: 2.0
public getFailedRules ( ) : Fuel\Validation\RuleInterface[]
Résultat Fuel\Validation\RuleInterface[]

getValidated() public méthode

Since: 2.0
public getValidated ( ) : string[]
Résultat string[]

isValid() public méthode

Since: 2.0
public isValid ( ) : boolean
Résultat boolean

merge() public méthode

public merge ( Fuel\Validation\ResultInterface $resultInterface, $fieldPrefix = '' )
$resultInterface Fuel\Validation\ResultInterface

setError() public méthode

Sets the error message for the given field
Since: 2.0
public setError ( string $field, string $message, string $rule )
$field string
$message string
$rule string

setResult() public méthode

Since: 2.0
public setResult ( boolean $isValid )
$isValid boolean

setValidated() public méthode

Since: 2.0
public setValidated ( string $field )
$field string

Property Details

$errors protected_oe property

Contains an array of errors that occurred during validation
protected string[] $errors
Résultat string[]

$failedRules protected_oe property

Contains the rule that caused a given field to fail
protected RuleInterface[],Fuel\Validation $failedRules
Résultat Fuel\Validation\RuleInterface[]

$result protected_oe property

Boolean flag to indicate overall failure or success
protected bool $result
Résultat boolean

$validated protected_oe property

Contains a list of fields that passed validation
protected string[] $validated
Résultat string[]