rodgermd / uniqueentitynotnull-bundle
Check if entity is unique if not null
Package info
github.com/rodgermd/UniqueNotNullEntity
Type:symfony-bundle
pkg:composer/rodgermd/uniqueentitynotnull-bundle
v0.1
2013-12-03 07:14 UTC
This package is not auto-updated.
Last update: 2026-02-24 09:16:24 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;
}