src/Entity/FormationGroup.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity
  8.  * @ORM\Table(name="mmpp_formation_group")
  9.  * @ORM\Entity(repositoryClass="App\Repository\FormationGroupRepository")
  10.  */
  11. class FormationGroup
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\GeneratedValue(strategy="AUTO")
  17.      */
  18.     protected $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     protected $name;
  23.     /**
  24.      * @ORM\Column(type="integer")
  25.      */
  26.     protected $position;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity="Center", inversedBy="groups")
  29.      * @ORM\JoinColumn(name="center_id", referencedColumnName="id")
  30.      */
  31.     protected $center;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity="Formation", mappedBy="group")
  34.      */
  35.     protected $formations;
  36.     /**
  37.      * Constructor
  38.      */
  39.     public function __construct()
  40.     {
  41.         $this->formations = new ArrayCollection();
  42.     }
  43.     /**
  44.      * Get id
  45.      *
  46.      * @return integer
  47.      */
  48.     public function getId()
  49.     {
  50.         return $this->id;
  51.     }
  52.     /**
  53.      * Set name
  54.      *
  55.      * @param string $name
  56.      * @return FormationGroup
  57.      */
  58.     public function setName($name)
  59.     {
  60.         $this->name $name;
  61.         return $this;
  62.     }
  63.     /**
  64.      * Get name
  65.      *
  66.      * @return string
  67.      */
  68.     public function getName()
  69.     {
  70.         return $this->name;
  71.     }
  72.     /**
  73.      * Set center
  74.      *
  75.      * @param \App\Entity\Center $center
  76.      * @return FormationGroup
  77.      */
  78.     public function setCenter(\App\Entity\Center $center null)
  79.     {
  80.         $this->center $center;
  81.         return $this;
  82.     }
  83.     /**
  84.      * Get center
  85.      *
  86.      * @return \App\Entity\Center
  87.      */
  88.     public function getCenter()
  89.     {
  90.         return $this->center;
  91.     }
  92.     /**
  93.      * Add formations
  94.      *
  95.      * @param \App\Entity\Formation $formations
  96.      * @return FormationGroup
  97.      */
  98.     public function addFormation(\App\Entity\Formation $formations)
  99.     {
  100.         $this->formations[] = $formations;
  101.         return $this;
  102.     }
  103.     /**
  104.      * Remove formations
  105.      *
  106.      * @param \App\Entity\Formation $formations
  107.      */
  108.     public function removeFormation(\App\Entity\Formation $formations)
  109.     {
  110.         $this->formations->removeElement($formations);
  111.     }
  112.     /**
  113.      * Get formations
  114.      *
  115.      * @return \Doctrine\Common\Collections\Collection
  116.      */
  117.     public function getFormations()
  118.     {
  119.         return $this->formations;
  120.     }
  121.     /**
  122.      * Set position
  123.      *
  124.      * @param integer $position
  125.      * @return FormationGroup
  126.      */
  127.     public function setPosition($position)
  128.     {
  129.         $this->position $position;
  130.         return $this;
  131.     }
  132.     /**
  133.      * Get position
  134.      *
  135.      * @return integer
  136.      */
  137.     public function getPosition()
  138.     {
  139.         return $this->position;
  140.     }
  141. }