rodgermd / uniqueentitynotnull-bundle
Check if entity is unique if not null
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
This package is not auto-updated.
Last update: 2024-12-17 03:30:20 UTC
README
Validates the entity if properties are unique if it is not null
Install
composer.json:
"rodgermd/uniqueentitynotnull-bundle": "dev-master"
AppKernel.php:
new Rodgermd\UniqueNotNullEntityBundle\RodgermdUniqueNotNullEntityBundle(),
Usage
use Rodgermd\UniqueNotNullEntityBundle\Validator as UniqueConstraints; # include namespace shortcut
/**
* @ORM\Entity
* @UniqueConstraints\HasUniqueProperties; # defines the class has properties to check, required to start validation
*/
class Entity {
/**
* @UniqueConstraints\UniqueProperty(message="Not unique property") # property to be validated
*/
protected $property;
}