<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\AnnonceFormatRepository")
*/
class AnnonceFormat
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private ?int $id;
/**
* @ORM\Column(type="string", length=255, options={"comment":"Nom interne"})
*/
private ?string $name;
/**
* @ORM\Column(type="float")
*/
private ?float $width;
/**
* @ORM\Column(type="float")
*/
private ?float $height;
/**
* @ORM\Column(type="string")
*/
private ?string $unit;
/**
* @ORM\Column(type="string", nullable=false)
*/
private ?string $publicationMode;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clef texte du format"})
*/
private ?string $key;
/**
* @ORM\Column(type="string", length=255, nullable=true) options={"comment":"Format du template"})
*/
private ?string $sizeKey;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\Annonce", mappedBy="annonceFormat", cascade={"persist"})
*/
private $annonces;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\TagAnnonce", inversedBy="annonceFormats")
*/
private $tags;
public function __construct()
{
$this->annonces = new ArrayCollection();
$this->tags = 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 getWidth() : ?float
{
return $this->width;
}
public function setWidth(float $width) : self
{
$this->width = $width;
return $this;
}
public function getHeight() : ?float
{
return $this->height;
}
public function setHeight(float $height) : self
{
$this->height = $height;
return $this;
}
public function getUnit() : ?string
{
return $this->unit;
}
public function setUnit(string $unit) : self
{
$this->unit = $unit;
return $this;
}
public function getPublicationMode() : ?string
{
return $this->publicationMode;
}
public function setPublicationMode(string $publicationMode) : self
{
$this->publicationMode = $publicationMode;
return $this;
}
public function getKey() : ?string
{
return $this->key;
}
public function setKey(?string $key) : self
{
$this->key = $key;
return $this;
}
public function getSizeKey() : ?string
{
return $this->sizeKey;
}
public function setSizeKey(?string $sizeKey) : self
{
$this->sizeKey = $sizeKey;
return $this;
}
/**
* @return Collection|Annonce[]
*/
public function getAnnonces() : Collection
{
return $this->annonces;
}
public function addAnnonce(Annonce $annonce) : self
{
if (!$this->annonces->contains($annonce)) {
$this->annonces[] = $annonce;
$annonce->setAnnonceFormat($this);
}
return $this;
}
public function removeAnnonce(Annonce $annonce) : self
{
if ($this->annonces->contains($annonce)) {
$this->annonces->removeElement($annonce);
// set the owning side to null (unless already changed)
if ($annonce->getAnnonceFormat() === $this) {
$annonce->setAnnonceFormat(null);
}
}
return $this;
}
/**
* @return Collection|TagAnnonce[]
*/
public function getTags() : Collection
{
return $this->tags;
}
public function addTag(TagAnnonce $tag) : self
{
if (!$this->tags->contains($tag)) {
$this->tags[] = $tag;
}
return $this;
}
public function removeTag(TagAnnonce $tag) : self
{
if ($this->tags->contains($tag)) {
$this->tags->removeElement($tag);
}
return $this;
}
}