src/Application/Sonata/UserBundle/Entity/Group.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Application\Sonata\UserBundle\Entity;
  3. use Sonata\UserBundle\Entity\BaseGroup as BaseGroup;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * User
  7.  *
  8.  * @ORM\Table(name="fos_user_group")
  9.  * @ORM\Entity
  10.  */
  11. class Group extends BaseGroup
  12. {
  13.   /**
  14.    * @var integer
  15.    *
  16.    * @ORM\Column(name="id", type="integer")
  17.    * @ORM\Id
  18.    * @ORM\GeneratedValue(strategy="AUTO")
  19.    */
  20.   protected $id;
  21.   /**
  22.    * @ORM\ManyToMany(targetEntity="App\Application\Internit\SecurityBundle\Entity\Hierarchy", mappedBy="groups", cascade={"all"})
  23.    **/
  24.   private $hierarchy;
  25.     /**
  26.      * Get id.
  27.      *
  28.      * @return int $id
  29.      */
  30.     public function getId()
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getHierarchy() {
  35.       return $this->hierarchy;
  36.     }
  37.     public function setHierarchy($hierarchy) {
  38.       $this->hierarchy $hierarchy;
  39.       return $this;
  40.     }
  41.     public function addHierarchy($hierarchy)
  42.     {      
  43.       $this->hierarchys->add($hierarchy);
  44.       return $this;
  45.     }
  46.     public function removeHierarchy($hierarchy)
  47.     {
  48.       $this->hierarchys->removeElement($hierarchy);
  49.       return $this;
  50.     }
  51. }