Download the PHP package k2gl/entity-exist without Composer
On this page you can find all versions of the php package k2gl/entity-exist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download k2gl/entity-exist
More information about k2gl/entity-exist
Files in k2gl/entity-exist
Package entity-exist
Short Description Checks if there is at least one row with the required field in the database, for example, a row with the same identifier
License MIT
Informations about the package entity-exist
Assert entity exist or not using Symfony constraints and Doctrine.
Requirements
- PHP 8.1+
- Symfony 6.1, 7.x or 8.x (
symfony/validator,symfony/dependency-injection) - Doctrine ORM 2.13+ or 3.x
Installation
You can add this library as a local, per-project dependency to your project using Composer:
Configuration
Makes classes in src/ available to be used as services in services.yaml
Usage
AssertEntityNotExist
AssertEntityExist
Violation codes
Each constraint declares the violation code it emits as a UUID constant on its
own class (AssertEntityExist::NOT_EXIST, AssertEntityNotExist::EXIST).
Reading those at the call site can be awkward — especially
AssertEntityNotExist::EXIST, where the class name and the constant negate
each other.
For nicer reading in error handling and tests, the same codes are also exposed
under neutral names on ViolationCode:
ViolationCode constants are plain strings that reference the constraint
constants — no duplication, no separate source of truth.
Pull requests are always welcome
All versions of entity-exist with dependencies
doctrine/orm Version ^2.13|^3.0
symfony/validator Version ^6.1|^7.0|^8.0
symfony/dependency-injection Version ^6.1|^7.0|^8.0