Created
April 29, 2015 09:51
-
-
Save CharlyPoppins/9809c6cd43da01480cd9 to your computer and use it in GitHub Desktop.
@ UniqueEntity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Symfony\Component\Validator\ExecutionContextInterface; | |
use Knp\DoctrineBehaviors\Model as ORMBehaviors; | |
/** | |
* @ORM\Table("Test") | |
* @ORM\Entity(repositoryClass="Charly\TestBundle\Entity\TestRepository") | |
* @ORM\HasLifecycleCallbacks | |
* @UniqueEntity("reference") | |
*/ | |
class Test | |
{ | |
/** | |
* @Assert\NotBlank() | |
* @ORM\Column(type="string", length=255, unique=true) | |
*/ | |
private $reference; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment