arad021 / entity-already-exists-validation-constraint
Verify that your entity does not exists
Package info
github.com/arad021/entity-already-exists-validation-constraint
pkg:composer/arad021/entity-already-exists-validation-constraint
Fund package maintenance!
1.0.1
2023-11-15 13:44 UTC
Requires
- php: ^8.1
- doctrine/orm: ^2.4
- symfony/validator: ^3.4 || ^4.4 || ^5.0 || ^6.0
Requires (Dev)
- symfony/phpunit-bridge: ^5.3
This package is auto-updated.
Last update: 2026-03-15 20:03:56 UTC
README
A small validator that verifies that an entity actually does not exist.
Install
composer require arad021/entity-already-exists-validation-constraint
Then register the services with:
# config/packages/arad021_entity_already_exists_validator.yaml services: Arad021\Validator\Constraint\EntityNotExistValidator: arguments: ['@doctrine.orm.entity_manager'] tags: [ 'validator.constraint_validator' ]
Note
The validator will not produce a violation when value is empty. This means that you should most likely use it in
combination with NotBlank.