<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @ORM\Table(name="mmpp_form_formulaire")
* @ORM\Entity(repositoryClass="App\Repository\FormulaireRepository")
*/
class Formulaire
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
public $id;
/**
* @ORM\Column(type="string", length=255)
*/
public $name;
/**
* @Gedmo\Slug(fields={"name"}, updatable=false, separator="-")
* @ORM\Column(type="string", length=255)
* @var String
*/
protected $slug;
/**
* @ORM\Column(type="string", name="payment_type", length=255)
*/
private $paymentType;
/**
* @ORM\ManyToMany(targetEntity="FormulaireBlock", mappedBy="formulaires")
* @ORM\OrderBy({"position" = "ASC"})
* @var FormulaireBlock[]
*/
protected $blocks;
/**
* @ORM\OneToMany(targetEntity="InscriptionFile", mappedBy="formulaire")
* @var InscriptionFile[]
*/
protected $files;
/**
* @ORM\OneToMany(targetEntity="Preinscription", mappedBy="formulaire")
* @var Preinscription[]
*/
protected $preinscriptions;
/**
* @ORM\OneToMany(targetEntity="Formation", mappedBy="formulaire")
* @var Formation[]
*/
protected $formations;
/**
* @ORM\Column(type="text", name="conversion_tracking_script", nullable=true)
* @var String
*/
protected $conversionTrackingScript;
/**
* @ORM\Column(type="boolean", name="is_active", nullable=true)
* @var boolean
*/
protected $isActive;
public function __construct()
{
$this->blocks = new ArrayCollection();
$this->files = new ArrayCollection();
$this->preinscriptions = new ArrayCollection();
$this->formations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getPaymentType(): ?string
{
return $this->paymentType;
}
public function setPaymentType(string $paymentType): self
{
$this->paymentType = $paymentType;
return $this;
}
public function getConversionTrackingScript(): ?string
{
return $this->conversionTrackingScript;
}
public function setConversionTrackingScript(?string $conversionTrackingScript): self
{
$this->conversionTrackingScript = $conversionTrackingScript;
return $this;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
/**
* @return Collection<int, FormulaireBlock>
*/
public function getBlocks(): Collection
{
return $this->blocks;
}
public function addBlock(FormulaireBlock $block): self
{
if (!$this->blocks->contains($block)) {
$this->blocks->add($block);
$block->addFormulaire($this);
}
return $this;
}
public function removeBlock(FormulaireBlock $block): self
{
if ($this->blocks->removeElement($block)) {
$block->removeFormulaire($this);
}
return $this;
}
/**
* @return Collection<int, InscriptionFile>
*/
public function getFiles(): Collection
{
return $this->files;
}
public function addFile(InscriptionFile $file): self
{
if (!$this->files->contains($file)) {
$this->files->add($file);
$file->setFormulaire($this);
}
return $this;
}
public function removeFile(InscriptionFile $file): self
{
if ($this->files->removeElement($file)) {
// set the owning side to null (unless already changed)
if ($file->getFormulaire() === $this) {
$file->setFormulaire(null);
}
}
return $this;
}
/**
* @return Collection<int, Preinscription>
*/
public function getPreinscriptions(): Collection
{
return $this->preinscriptions;
}
public function addPreinscription(Preinscription $preinscription): self
{
if (!$this->preinscriptions->contains($preinscription)) {
$this->preinscriptions->add($preinscription);
$preinscription->setFormulaire($this);
}
return $this;
}
public function removePreinscription(Preinscription $preinscription): self
{
if ($this->preinscriptions->removeElement($preinscription)) {
// set the owning side to null (unless already changed)
if ($preinscription->getFormulaire() === $this) {
$preinscription->setFormulaire(null);
}
}
return $this;
}
/**
* @return Collection<int, Formation>
*/
public function getFormations(): Collection
{
return $this->formations;
}
public function addFormation(Formation $formation): self
{
if (!$this->formations->contains($formation)) {
$this->formations->add($formation);
$formation->setFormulaire($this);
}
return $this;
}
public function removeFormation(Formation $formation): self
{
if ($this->formations->removeElement($formation)) {
// set the owning side to null (unless already changed)
if ($formation->getFormulaire() === $this) {
$formation->setFormulaire(null);
}
}
return $this;
}
}