src/Entity/Formulaire.php line 16

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\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="mmpp_form_formulaire")
  11.  * @ORM\Entity(repositoryClass="App\Repository\FormulaireRepository")
  12.  */
  13. class Formulaire
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="integer")
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     public $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     public $name;
  25.     /**
  26.      * @Gedmo\Slug(fields={"name"}, updatable=false, separator="-")
  27.      * @ORM\Column(type="string", length=255)
  28.      * @var String
  29.      */
  30.     protected $slug;
  31.     /**
  32.      * @ORM\Column(type="string", name="payment_type", length=255)
  33.      */
  34.     private $paymentType;
  35.     /**
  36.      * @ORM\ManyToMany(targetEntity="FormulaireBlock", mappedBy="formulaires")
  37.      * @ORM\OrderBy({"position" = "ASC"})
  38.      * @var FormulaireBlock[]
  39.      */
  40.     protected $blocks;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="InscriptionFile", mappedBy="formulaire")
  43.      * @var InscriptionFile[]
  44.      */
  45.     protected $files;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity="Preinscription", mappedBy="formulaire")
  48.      * @var Preinscription[]
  49.      */
  50.     protected $preinscriptions;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity="Formation", mappedBy="formulaire")
  53.      * @var Formation[]
  54.      */
  55.     protected $formations;
  56.     /**
  57.      * @ORM\Column(type="text", name="conversion_tracking_script", nullable=true)
  58.      * @var String
  59.      */
  60.     protected $conversionTrackingScript;
  61.     /**
  62.      * @ORM\Column(type="boolean", name="is_active", nullable=true)
  63.      * @var boolean
  64.      */
  65.     protected $isActive;
  66.     public function __construct()
  67.     {
  68.         $this->blocks = new ArrayCollection();
  69.         $this->files = new ArrayCollection();
  70.         $this->preinscriptions = new ArrayCollection();
  71.         $this->formations = new ArrayCollection();
  72.     }
  73.     public function getId(): ?int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function getName(): ?string
  78.     {
  79.         return $this->name;
  80.     }
  81.     public function setName(string $name): self
  82.     {
  83.         $this->name $name;
  84.         return $this;
  85.     }
  86.     public function getSlug(): ?string
  87.     {
  88.         return $this->slug;
  89.     }
  90.     public function setSlug(string $slug): self
  91.     {
  92.         $this->slug $slug;
  93.         return $this;
  94.     }
  95.     public function getPaymentType(): ?string
  96.     {
  97.         return $this->paymentType;
  98.     }
  99.     public function setPaymentType(string $paymentType): self
  100.     {
  101.         $this->paymentType $paymentType;
  102.         return $this;
  103.     }
  104.     public function getConversionTrackingScript(): ?string
  105.     {
  106.         return $this->conversionTrackingScript;
  107.     }
  108.     public function setConversionTrackingScript(?string $conversionTrackingScript): self
  109.     {
  110.         $this->conversionTrackingScript $conversionTrackingScript;
  111.         return $this;
  112.     }
  113.     public function isIsActive(): ?bool
  114.     {
  115.         return $this->isActive;
  116.     }
  117.     public function setIsActive(?bool $isActive): self
  118.     {
  119.         $this->isActive $isActive;
  120.         return $this;
  121.     }
  122.     /**
  123.      * @return Collection<int, FormulaireBlock>
  124.      */
  125.     public function getBlocks(): Collection
  126.     {
  127.         return $this->blocks;
  128.     }
  129.     public function addBlock(FormulaireBlock $block): self
  130.     {
  131.         if (!$this->blocks->contains($block)) {
  132.             $this->blocks->add($block);
  133.             $block->addFormulaire($this);
  134.         }
  135.         return $this;
  136.     }
  137.     public function removeBlock(FormulaireBlock $block): self
  138.     {
  139.         if ($this->blocks->removeElement($block)) {
  140.             $block->removeFormulaire($this);
  141.         }
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return Collection<int, InscriptionFile>
  146.      */
  147.     public function getFiles(): Collection
  148.     {
  149.         return $this->files;
  150.     }
  151.     public function addFile(InscriptionFile $file): self
  152.     {
  153.         if (!$this->files->contains($file)) {
  154.             $this->files->add($file);
  155.             $file->setFormulaire($this);
  156.         }
  157.         return $this;
  158.     }
  159.     public function removeFile(InscriptionFile $file): self
  160.     {
  161.         if ($this->files->removeElement($file)) {
  162.             // set the owning side to null (unless already changed)
  163.             if ($file->getFormulaire() === $this) {
  164.                 $file->setFormulaire(null);
  165.             }
  166.         }
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return Collection<int, Preinscription>
  171.      */
  172.     public function getPreinscriptions(): Collection
  173.     {
  174.         return $this->preinscriptions;
  175.     }
  176.     public function addPreinscription(Preinscription $preinscription): self
  177.     {
  178.         if (!$this->preinscriptions->contains($preinscription)) {
  179.             $this->preinscriptions->add($preinscription);
  180.             $preinscription->setFormulaire($this);
  181.         }
  182.         return $this;
  183.     }
  184.     public function removePreinscription(Preinscription $preinscription): self
  185.     {
  186.         if ($this->preinscriptions->removeElement($preinscription)) {
  187.             // set the owning side to null (unless already changed)
  188.             if ($preinscription->getFormulaire() === $this) {
  189.                 $preinscription->setFormulaire(null);
  190.             }
  191.         }
  192.         return $this;
  193.     }
  194.     /**
  195.      * @return Collection<int, Formation>
  196.      */
  197.     public function getFormations(): Collection
  198.     {
  199.         return $this->formations;
  200.     }
  201.     public function addFormation(Formation $formation): self
  202.     {
  203.         if (!$this->formations->contains($formation)) {
  204.             $this->formations->add($formation);
  205.             $formation->setFormulaire($this);
  206.         }
  207.         return $this;
  208.     }
  209.     public function removeFormation(Formation $formation): self
  210.     {
  211.         if ($this->formations->removeElement($formation)) {
  212.             // set the owning side to null (unless already changed)
  213.             if ($formation->getFormulaire() === $this) {
  214.                 $formation->setFormulaire(null);
  215.             }
  216.         }
  217.         return $this;
  218.     }
  219. }