bastien 12 vuotta sitten
vanhempi
commit
c532061b25
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      src/Muzich/CoreBundle/Entity/Group.php

+ 3 - 1
src/Muzich/CoreBundle/Entity/Group.php Näytä tiedosto

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