Skip to content

ValidateInterface

  • Full name: \Zemit\Mvc\Model\Interfaces\ValidateInterface

Methods

genericValidation

public genericValidation(?\Zemit\Filter\Validation $validator = null): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator ?\Zemit\Filter\Validation

addNotEmptyValidation

public addNotEmptyValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = false): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool

addPresenceValidation

public addPresenceValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool

addUnsignedIntValidation

public addUnsignedIntValidation(\Zemit\Filter\Validation $validator, array|string $field = 'id', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool

addUnsignedBigIntValidation

public addUnsignedBigIntValidation(\Zemit\Filter\Validation $validator, array|string $field = 'id', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool

addNumberValidation

public addNumberValidation(\Zemit\Filter\Validation $validator, array|string $field, int $min, int $max, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$min int
$max int
$allowEmpty bool

addStringLengthValidation

public addStringLengthValidation(\Zemit\Filter\Validation $validator, array|string $field, int $minChar, int $maxChar = 255, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$minChar int
$maxChar int
$allowEmpty bool

addInclusionInValidation

public addInclusionInValidation(\Zemit\Filter\Validation $validator, array|string $field, array $domainList = [], bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$domainList array
$allowEmpty bool

addBooleanValidation

public addBooleanValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool

addInclusionValidation

public addInclusionValidation(\Zemit\Filter\Validation $validator, array|string $field, array $domain = [], bool $allowEmpty = true, bool $strict = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$domain array
$allowEmpty bool
$strict bool

addUniquenessValidation

public addUniquenessValidation(\Zemit\Filter\Validation $validator, string|array $field, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **string array**
$allowEmpty bool

addEmailValidation

public addEmailValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool

addDateValidation

public addDateValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = true, string $format = Column::DATE_FORMAT): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool
$format string

addDateTimeValidation

public addDateTimeValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = true, string $format = Column::DATETIME_FORMAT): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool
$format string

addJsonValidation

public addJsonValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = true, int $depth = 512, int $flags): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool
$depth int
$flags int

addColorValidation

public addColorValidation(\Zemit\Filter\Validation $validator, array|string $field, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field **array string**
$allowEmpty bool

addIdValidation

public addIdValidation(\Zemit\Filter\Validation $validator, string $field = 'id'): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field string

addPositionValidation

public addPositionValidation(\Zemit\Filter\Validation $validator, string $field = 'position', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field string
$allowEmpty bool

addSoftDeleteValidation

public addSoftDeleteValidation(\Zemit\Filter\Validation $validator, string $field = 'deleted', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field string
$allowEmpty bool

addUuidValidation

public addUuidValidation(\Zemit\Filter\Validation $validator, string $field = 'uuid', bool $allowEmpty = false): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$field string
$allowEmpty bool

addCrudValidation

public addCrudValidation(\Zemit\Filter\Validation $validator, string $userIdField, string $dateField, bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$userIdField string
$dateField string
$allowEmpty bool

addCreatedValidation

public addCreatedValidation(\Zemit\Filter\Validation $validator, string $createdByField = 'createdBy', string $createdAtField = 'createdAt', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$createdByField string
$createdAtField string
$allowEmpty bool

addUpdatedValidation

public addUpdatedValidation(\Zemit\Filter\Validation $validator, string $updatedByField = 'updatedBy', string $updatedAtField = 'updatedAt', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$updatedByField string
$updatedAtField string
$allowEmpty bool

addDeletedValidation

public addDeletedValidation(\Zemit\Filter\Validation $validator, string $deletedField = 'deletedBy', string $dateField = 'deletedAt', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$deletedField string
$dateField string
$allowEmpty bool

addRestoredValidation

public addRestoredValidation(\Zemit\Filter\Validation $validator, string $restoredByField = 'restoredBy', string $restoredAtField = 'restoredAt', bool $allowEmpty = true): \Zemit\Filter\Validation

Parameters:

Parameter Type Description
$validator \Zemit\Filter\Validation
$restoredByField string
$restoredAtField string
$allowEmpty bool