PHP Class CRUDlex\UniqueValidator

Inheritance: implements Valdi\Validator\ValidatorInterface
Afficher le fichier Open project: philiplb/crudlex Class Usage Examples

Méthodes publiques

Méthode Description
getInvalidDetails ( )
isValid ( $value, array $parameters )

Méthodes protégées

Méthode Description
isValidUnique ( $value, AbstractData $data, Entity $entity, $field ) : boolean Performs the regular unique validation.
isValidUniqueMany ( array $value, AbstractData $data, Entity $entity, $field ) : boolean Checks whether the unique constraint is valid for a many-to-many field.

Method Details

getInvalidDetails() public méthode

public getInvalidDetails ( )

isValid() public méthode

public isValid ( $value, array $parameters )
$parameters array

isValidUnique() protected méthode

Performs the regular unique validation.
protected isValidUnique ( $value, AbstractData $data, Entity $entity, $field ) : boolean
$value the value to validate
$data AbstractData the data instance to validate with
$entity Entity the entity of the field
$field the field to validate
Résultat boolean true if everything is valid

isValidUniqueMany() protected méthode

Checks whether the unique constraint is valid for a many-to-many field.
protected isValidUniqueMany ( array $value, AbstractData $data, Entity $entity, $field ) : boolean
$value array the value to check
$data AbstractData the data to perform the check with
$entity Entity the entity to perform the check on
$field the many field to perform the check on
Résultat boolean true if it is a valid unique many-to-many constraint