src/Entity/FormulaireBlock.php line 13

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_form_block")
  9.  */
  10. class FormulaireBlock
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      */
  17.     protected $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     protected $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     protected $label;
  26.     /**
  27.      * @ORM\Column(type="integer")
  28.      */
  29.     protected $position;
  30.     /**
  31.      * @ORM\ManyToMany(targetEntity="Formulaire", inversedBy="blocks")
  32.      * @ORM\JoinTable(name="mmpp_form_formulaires_blocks",
  33.      *      joinColumns={@ORM\JoinColumn(name="formulaireblock_id", referencedColumnName="id")},
  34.      *      inverseJoinColumns={@ORM\JoinColumn(name="formulaire_id", referencedColumnName="id")}
  35.      * )
  36.      */
  37.     protected $formulaires;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="FormulaireField", mappedBy="block")
  40.      * @ORM\OrderBy({"position" = "ASC"})
  41.      * @var unknown
  42.      */
  43.     protected $fields;
  44.     /**
  45.      * Constructor
  46.      */
  47.     public function __construct()
  48.     {
  49.         $this->formulaires = new \Doctrine\Common\Collections\ArrayCollection();
  50.         $this->fields = new \Doctrine\Common\Collections\ArrayCollection();
  51.     }
  52.     /**
  53.      * Get id
  54.      *
  55.      * @return integer
  56.      */
  57.     public function getId()
  58.     {
  59.         return $this->id;
  60.     }
  61.     /**
  62.      * Set name
  63.      *
  64.      * @param string $name
  65.      * @return FormulaireBlock
  66.      */
  67.     public function setName($name)
  68.     {
  69.         $this->name $name;
  70.         return $this;
  71.     }
  72.     /**
  73.      * Get name
  74.      *
  75.      * @return string
  76.      */
  77.     public function getName()
  78.     {
  79.         return $this->name;
  80.     }
  81.     /**
  82.      * Set label
  83.      *
  84.      * @param string $label
  85.      * @return FormulaireBlock
  86.      */
  87.     public function setLabel($label)
  88.     {
  89.         $this->label $label;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Get label
  94.      *
  95.      * @return string
  96.      */
  97.     public function getLabel()
  98.     {
  99.         return $this->label;
  100.     }
  101.     /**
  102.      * Set position
  103.      *
  104.      * @param integer $position
  105.      * @return FormulaireBlock
  106.      */
  107.     public function setPosition($position)
  108.     {
  109.         $this->position $position;
  110.         return $this;
  111.     }
  112.     /**
  113.      * Get position
  114.      *
  115.      * @return integer
  116.      */
  117.     public function getPosition()
  118.     {
  119.         return $this->position;
  120.     }
  121.     /**
  122.      * Add formulaires
  123.      *
  124.      * @param \App\Entity\Formulaire $formulaires
  125.      * @return FormulaireBlock
  126.      */
  127.     public function addFormulaire(\App\Entity\Formulaire $formulaires)
  128.     {
  129.         $this->formulaires[] = $formulaires;
  130.         return $this;
  131.     }
  132.     /**
  133.      * Remove formulaires
  134.      *
  135.      * @param \App\Entity\Formulaire $formulaires
  136.      */
  137.     public function removeFormulaire(\App\Entity\Formulaire $formulaires)
  138.     {
  139.         $this->formulaires->removeElement($formulaires);
  140.     }
  141.     /**
  142.      * Get formulaires
  143.      *
  144.      * @return \Doctrine\Common\Collections\Collection
  145.      */
  146.     public function getFormulaires()
  147.     {
  148.         return $this->formulaires;
  149.     }
  150.     /**
  151.      * Add fields
  152.      *
  153.      * @param \App\Entity\FormulaireField $fields
  154.      * @return FormulaireBlock
  155.      */
  156.     public function addField(\App\Entity\FormulaireField $fields)
  157.     {
  158.         $this->fields[] = $fields;
  159.         return $this;
  160.     }
  161.     /**
  162.      * Remove fields
  163.      *
  164.      * @param \App\Entity\FormulaireField $fields
  165.      */
  166.     public function removeField(\App\Entity\FormulaireField $fields)
  167.     {
  168.         $this->fields->removeElement($fields);
  169.     }
  170.     /**
  171.      * Get fields
  172.      *
  173.      * @return \Doctrine\Common\Collections\Collection
  174.      */
  175.     public function getFields()
  176.     {
  177.         return $this->fields;
  178.     }
  179. }