src/Entity/AnnonceFormat.php line 11

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\AnnonceFormatRepository")
  8.  */
  9. class AnnonceFormat
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private ?int $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, options={"comment":"Nom interne"})
  19.      */
  20.     private ?string $name;
  21.     /**
  22.      * @ORM\Column(type="float")
  23.      */
  24.     private ?float $width;
  25.     /**
  26.      * @ORM\Column(type="float")
  27.      */
  28.     private ?float $height;
  29.     /**
  30.      * @ORM\Column(type="string")
  31.      */
  32.     private ?string $unit;
  33.     /**
  34.      * @ORM\Column(type="string", nullable=false)
  35.      */
  36.     private ?string $publicationMode;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clef texte du format"})
  39.      */
  40.     private ?string $key;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true) options={"comment":"Format du template"})
  43.      */
  44.     private ?string $sizeKey;
  45.     /**
  46.      * @var \Doctrine\Common\Collections\Collection
  47.      *
  48.      * @ORM\OneToMany(targetEntity="App\Entity\Annonce", mappedBy="annonceFormat", cascade={"persist"})
  49.      */
  50.     private $annonces;
  51.     /**
  52.      * @ORM\ManyToMany(targetEntity="App\Entity\TagAnnonce", inversedBy="annonceFormats")
  53.      */
  54.     private $tags;
  55.     public function __construct()
  56.     {
  57.         $this->annonces = new ArrayCollection();
  58.         $this->tags = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getName() : ?string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function setName(?string $name) : self
  69.     {
  70.         $this->name $name;
  71.         return $this;
  72.     }
  73.     public function getWidth() : ?float
  74.     {
  75.         return $this->width;
  76.     }
  77.     public function setWidth(float $width) : self
  78.     {
  79.         $this->width $width;
  80.         return $this;
  81.     }
  82.     public function getHeight() : ?float
  83.     {
  84.         return $this->height;
  85.     }
  86.     public function setHeight(float $height) : self
  87.     {
  88.         $this->height $height;
  89.         return $this;
  90.     }
  91.     public function getUnit() : ?string
  92.     {
  93.         return $this->unit;
  94.     }
  95.     public function setUnit(string $unit) : self
  96.     {
  97.         $this->unit $unit;
  98.         return $this;
  99.     }
  100.     public function getPublicationMode() : ?string
  101.     {
  102.         return $this->publicationMode;
  103.     }
  104.     public function setPublicationMode(string $publicationMode) : self
  105.     {
  106.         $this->publicationMode $publicationMode;
  107.         return $this;
  108.     }
  109.     public function getKey() : ?string
  110.     {
  111.         return $this->key;
  112.     }
  113.     public function setKey(?string $key) : self
  114.     {
  115.         $this->key $key;
  116.         return $this;
  117.     }
  118.     public function getSizeKey() : ?string
  119.     {
  120.         return $this->sizeKey;
  121.     }
  122.     public function setSizeKey(?string $sizeKey) : self
  123.     {
  124.         $this->sizeKey $sizeKey;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return Collection|Annonce[]
  129.      */
  130.     public function getAnnonces() : Collection
  131.     {
  132.         return $this->annonces;
  133.     }
  134.     public function addAnnonce(Annonce $annonce) : self
  135.     {
  136.         if (!$this->annonces->contains($annonce)) {
  137.             $this->annonces[] = $annonce;
  138.             $annonce->setAnnonceFormat($this);
  139.         }
  140.         return $this;
  141.     }
  142.     public function removeAnnonce(Annonce $annonce) : self
  143.     {
  144.         if ($this->annonces->contains($annonce)) {
  145.             $this->annonces->removeElement($annonce);
  146.             // set the owning side to null (unless already changed)
  147.             if ($annonce->getAnnonceFormat() === $this) {
  148.                 $annonce->setAnnonceFormat(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection|TagAnnonce[]
  155.      */
  156.     public function getTags() : Collection
  157.     {
  158.         return $this->tags;
  159.     }
  160.     public function addTag(TagAnnonce $tag) : self
  161.     {
  162.         if (!$this->tags->contains($tag)) {
  163.             $this->tags[] = $tag;
  164.         }
  165.         return $this;
  166.     }
  167.     public function removeTag(TagAnnonce $tag) : self
  168.     {
  169.         if ($this->tags->contains($tag)) {
  170.             $this->tags->removeElement($tag);
  171.         }
  172.         return $this;
  173.     }
  174. }