<?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\TypePubRepository::class)]
class TypePub
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $libelle;
#[ORM\OneToMany(targetEntity: \App\Entity\Publicite::class, mappedBy: 'type')]
private $publicite;
public function __construct()
{
$this->publicite = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return Collection|Publicite[]
*/
public function getPublicite(): Collection
{
return $this->publicite;
}
public function addPublicite(Publicite $publicite): self
{
if (!$this->publicite->contains($publicite)) {
$this->publicite[] = $publicite;
$publicite->setType($this);
}
return $this;
}
public function removePublicite(Publicite $publicite): self
{
if ($this->publicite->contains($publicite)) {
$this->publicite->removeElement($publicite);
// set the owning side to null (unless already changed)
if ($publicite->getType() === $this) {
$publicite->setType(null);
}
}
return $this;
}
}