PHP Class CRUDlex\UniqueValidator

Inheritance: implements Valdi\Validator\ValidatorInterface
显示文件 Open project: philiplb/crudlex Class Usage Examples

Public Methods

Method Description
getInvalidDetails ( )
isValid ( $value, array $parameters )

Protected Methods

Method 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 method

public getInvalidDetails ( )

isValid() public method

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

isValidUnique() protected method

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
return boolean true if everything is valid

isValidUniqueMany() protected method

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
return boolean true if it is a valid unique many-to-many constraint