Guest User

Untitled

a guest
Aug 15th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. <?php
  2.  
  3. namespace SeguridadBundle\Entity;
  4.  
  5. use FOS\UserBundle\Model\Group as BaseGroup;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="fos_group")
  11.  */
  12. class Group extends BaseGroup
  13. {
  14.  
  15.  
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\Column(type="integer")
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     protected $id;
  22.  
  23.     /**
  24.      * GRUPOS
  25.      * @ORM\OneToMany(targetEntity="SeguridadBundle\Entity\UserGroup", mappedBy="grupo", cascade={"persist", "remove"})
  26.      */
  27.     private $grupos;
  28.  
  29.  
  30.     /**
  31.      * Add grupo
  32.      *
  33.      * @param \SeguridadBundle\Entity\UserGroup $grupo
  34.      *
  35.      * @return Group
  36.      */
  37.     public function addGrupo(\SeguridadBundle\Entity\UserGroup $grupo)
  38.     {
  39.         $this->grupos[] = $grupo;
  40.  
  41.         return $this;
  42.     }
  43.  
  44.     /**
  45.      * Remove grupo
  46.      *
  47.      * @param \SeguridadBundle\Entity\UserGroup $grupo
  48.      */
  49.     public function removeGrupo(\SeguridadBundle\Entity\UserGroup $grupo)
  50.     {
  51.         $this->grupos->removeElement($grupo);
  52.     }
  53.  
  54.     /**
  55.      * Get grupos
  56.      *
  57.      * @return \Doctrine\Common\Collections\Collection
  58.      */
  59.     public function getGrupos()
  60.     {
  61.         return $this->grupos;
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment