bastien 13 years ago
parent
commit
c532061b25
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Muzich/CoreBundle/Entity/Group.php

+ 3 - 1
src/Muzich/CoreBundle/Entity/Group.php View File

9
 use Muzich\CoreBundle\Entity\GroupsTagsFavorites;
9
 use Muzich\CoreBundle\Entity\GroupsTagsFavorites;
10
 use Symfony\Component\Validator\Constraints as Assert;
10
 use Symfony\Component\Validator\Constraints as Assert;
11
 use Muzich\CoreBundle\Validator as MuzichAssert;
11
 use Muzich\CoreBundle\Validator as MuzichAssert;
12
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
12
 
13
 
13
 /**
14
 /**
14
  * Le groupe est une sorte de liste de diffusion, a laquelle les
15
  * Le groupe est une sorte de liste de diffusion, a laquelle les
19
  * @ORM\Entity
20
  * @ORM\Entity
20
  * @ORM\Table(name="m_group")
21
  * @ORM\Table(name="m_group")
21
  * @ORM\Entity(repositoryClass="Muzich\CoreBundle\Repository\GroupRepository")
22
  * @ORM\Entity(repositoryClass="Muzich\CoreBundle\Repository\GroupRepository")
23
+ * @UniqueEntity("name")
22
  */
24
  */
23
 class Group
25
 class Group
24
 {
26
 {
34
   /**
36
   /**
35
    * Nom du groupe
37
    * Nom du groupe
36
    * 
38
    * 
37
-   * @ORM\Column(type="string", length=128)
39
+   * @ORM\Column(type="string", length=128, unique=true)
38
    * @Assert\NotBlank()
40
    * @Assert\NotBlank()
39
    * @Assert\MinLength(limit=3)
41
    * @Assert\MinLength(limit=3)
40
    * @Assert\MaxLength(64)
42
    * @Assert\MaxLength(64)