src/Entity/EditionModele.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 (repositoryClass="App\Repository\EditionModeleRepository")
  8.  */
  9. class EditionModele
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du modele"})
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplate", inversedBy="modeles")
  23.      * @ORM\JoinColumns({
  24.      *   @ORM\JoinColumn(name="template_id", referencedColumnName="id")
  25.      * })
  26.      */
  27.     private $template;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplateVariant", inversedBy="modeles", cascade={"persist"})
  30.      * @ORM\JoinColumns({
  31.      *   @ORM\JoinColumn(name="variant_id", referencedColumnName="id")
  32.      * })
  33.      */
  34.     private $variant;
  35.     /**
  36.      * @var \Doctrine\Common\Collections\Collection
  37.      *
  38.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubrique", mappedBy="modele", cascade={"persist","remove"}, orphanRemoval=true)
  39.      * @ORM\OrderBy({"ordering" = "ASC"})
  40.      */
  41.     private $rubriques;
  42.     /**
  43.      * @var \Doctrine\Common\Collections\Collection
  44.      *
  45.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleParameter", mappedBy="modele", cascade={"persist","remove"})
  46.      * @ORM\OrderBy({"ordering" = "ASC"})
  47.      */
  48.     private $parameters;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="editionModeles")
  51.      * @ORM\JoinColumns({
  52.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  53.      * })
  54.      */
  55.     private $owner;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="editionModeles")
  58.      * @ORM\JoinColumns({
  59.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  60.      * })
  61.      */
  62.     private $entity;
  63.     /**
  64.      * @ORM\Column(type="datetime", nullable=true)
  65.      */
  66.     private $createdAt;
  67.     /**
  68.      * @ORM\Column(type="datetime", nullable=true)
  69.      */
  70.     private $updatedAt;
  71.     /**
  72.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  73.      */
  74.     private $state;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity="App\Entity\EditionPlanification", mappedBy="modele")
  77.      */
  78.     private $planifications;
  79.     /**
  80.      * @ORM\Column(type="text", nullable=true)
  81.      */
  82.     private $customCss;
  83.     /**
  84.      * @ORM\Column(type="boolean", nullable=true, options={"default": false})
  85.      */
  86.     private $isInBookletMode;
  87.     /**
  88.      * @ORM\Column(type="boolean", nullable=true, options={"default": false})
  89.      */
  90.     private $isInAnnonceMode;
  91.     /**
  92.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplatePied", inversedBy="modeles", cascade={"persist"})
  93.      * @ORM\JoinColumns({
  94.      *   @ORM\JoinColumn(name="pied_id", referencedColumnName="id")
  95.      * })
  96.      */
  97.     private ?EditionTemplatePied $pied;
  98.     /**
  99.      * @ORM\ManyToMany(targetEntity="App\Entity\CustomCode", inversedBy="editionModeles")
  100.      */
  101.     private $customCodes;
  102.     public function __construct()
  103.     {
  104.         $this->rubriques = new ArrayCollection();
  105.         $this->parameters = new ArrayCollection();
  106.         $this->planifications = new ArrayCollection();
  107.         $this->customCodes = new ArrayCollection();
  108.     }
  109.     public function getId() : ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     public function getName() : ?string
  114.     {
  115.         return $this->name;
  116.     }
  117.     public function setName(?string $name) : self
  118.     {
  119.         $this->name $name;
  120.         return $this;
  121.     }
  122.     public function getCreatedAt() : ?\DateTimeInterface
  123.     {
  124.         return $this->createdAt;
  125.     }
  126.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  127.     {
  128.         $this->createdAt $createdAt;
  129.         return $this;
  130.     }
  131.     public function getUpdatedAt() : ?\DateTimeInterface
  132.     {
  133.         return $this->updatedAt;
  134.     }
  135.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  136.     {
  137.         $this->updatedAt $updatedAt;
  138.         return $this;
  139.     }
  140.     public function getState() : ?int
  141.     {
  142.         return $this->state;
  143.     }
  144.     public function setState(?int $state) : self
  145.     {
  146.         $this->state $state;
  147.         return $this;
  148.     }
  149.     public function getTemplate() : ?EditionTemplate
  150.     {
  151.         return $this->template;
  152.     }
  153.     public function setTemplate(?EditionTemplate $template) : self
  154.     {
  155.         $this->template $template;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection|EditionModeleRubrique[]
  160.      */
  161.     public function getRubriques() : Collection
  162.     {
  163.         return $this->rubriques;
  164.     }
  165.     public function addRubrique(EditionModeleRubrique $rubrique) : self
  166.     {
  167.         if (!$this->rubriques->contains($rubrique)) {
  168.             $this->rubriques[] = $rubrique;
  169.             $rubrique->setModele($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeRubrique(EditionModeleRubrique $rubrique) : self
  174.     {
  175.         if ($this->rubriques->contains($rubrique)) {
  176.             $this->rubriques->removeElement($rubrique);
  177.             // set the owning side to null (unless already changed)
  178.             if ($rubrique->getModele() === $this) {
  179.                 $rubrique->setModele(null);
  180.             }
  181.         }
  182.         return $this;
  183.     }
  184.     /**
  185.      * @return Collection|EditionModeleParameter[]
  186.      */
  187.     public function getParameters() : Collection
  188.     {
  189.         return $this->parameters;
  190.     }
  191.     public function addParameter(EditionModeleParameter $parameter) : self
  192.     {
  193.         if (!$this->parameters->contains($parameter)) {
  194.             $this->parameters[] = $parameter;
  195.             $parameter->setModele($this);
  196.         }
  197.         return $this;
  198.     }
  199.     public function removeParameter(EditionModeleParameter $parameter) : self
  200.     {
  201.         if ($this->parameters->contains($parameter)) {
  202.             $this->parameters->removeElement($parameter);
  203.             // set the owning side to null (unless already changed)
  204.             if ($parameter->getModele() === $this) {
  205.                 $parameter->setModele(null);
  206.             }
  207.         }
  208.         return $this;
  209.     }
  210.     public function getOwner() : ?User
  211.     {
  212.         return $this->owner;
  213.     }
  214.     public function setOwner(?User $owner) : self
  215.     {
  216.         $this->owner $owner;
  217.         return $this;
  218.     }
  219.     public function getEntity() : ?DnsitEntity
  220.     {
  221.         return $this->entity;
  222.     }
  223.     public function setEntity(?DnsitEntity $entity) : self
  224.     {
  225.         $this->entity $entity;
  226.         return $this;
  227.     }
  228.     public function getVariant() : ?EditionTemplateVariant
  229.     {
  230.         return $this->variant;
  231.     }
  232.     public function setVariant(?EditionTemplateVariant $variant) : self
  233.     {
  234.         $this->variant $variant;
  235.         return $this;
  236.     }
  237.     /**
  238.      * @return Collection|EditionPlanification[]
  239.      */
  240.     public function getPlanifications() : Collection
  241.     {
  242.         return $this->planifications;
  243.     }
  244.     public function addPlanification(EditionPlanification $planification) : self
  245.     {
  246.         if (!$this->planifications->contains($planification)) {
  247.             $this->planifications[] = $planification;
  248.             $planification->setModele($this);
  249.         }
  250.         return $this;
  251.     }
  252.     public function removePlanification(EditionPlanification $planification) : self
  253.     {
  254.         if ($this->planifications->contains($planification)) {
  255.             $this->planifications->removeElement($planification);
  256.             // set the owning side to null (unless already changed)
  257.             if ($planification->getModele() === $this) {
  258.                 $planification->setModele(null);
  259.             }
  260.         }
  261.         return $this;
  262.     }
  263.     public function getCustomCss() : ?string
  264.     {
  265.         return $this->customCss;
  266.     }
  267.     public function setCustomCss(?string $customCss) : self
  268.     {
  269.         $this->customCss $customCss;
  270.         return $this;
  271.     }
  272.     public function getIsInBookletMode() : ?bool
  273.     {
  274.         return $this->isInBookletMode;
  275.     }
  276.     public function setIsInBookletMode(?bool $isInBookletMode) : self
  277.     {
  278.         $this->isInBookletMode $isInBookletMode;
  279.         return $this;
  280.     }
  281.     public function getIsInAnnonceMode(): ?bool
  282.     {
  283.         return $this->isInAnnonceMode;
  284.     }
  285.     public function setIsInAnnonceMode(?bool $isInAnnonceMode): self
  286.     {
  287.         $this->isInAnnonceMode $isInAnnonceMode;
  288.         return $this;
  289.     }
  290.     public function getPied() : ?EditionTemplatePied
  291.     {
  292.         return $this->pied;
  293.     }
  294.     public function setPied(?EditionTemplatePied $pied) : self
  295.     {
  296.         $this->pied $pied;
  297.         return $this;
  298.     }
  299.     /**
  300.      * @return Collection|CustomCode[]
  301.      */
  302.     public function getCustomCodes () : Collection
  303.     {
  304.         return $this->customCodes;
  305.     }
  306.     public function addCustomCode (CustomCode $code) : self
  307.     {
  308.         if (!$this->customCodes->contains($code)) {
  309.             $this->customCodes[] = $code;
  310.         }
  311.         return $this;
  312.     }
  313.     public function removeCustomCode(CustomCode $code) : self
  314.     {
  315.         if ($this->customCodes->contains($code)) {
  316.             $this->customCodes->removeElement($code);
  317.         }
  318.         return $this;
  319.     }
  320. }