<?php
namespace App\Entity;
use App\Repository\ServiceThemeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ServiceThemeRepository::class)]
class ServiceTheme implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $titre= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $pictogramme_vert= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $pictogramme_bleu= null;
#[ORM\ManyToMany(targetEntity: Service::class, mappedBy: 'themes')]
private mixed $services;
#[ORM\ManyToMany(targetEntity: ServiceFocusPub::class, mappedBy: 'themes')]
private mixed $serviceFocusPubs;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $alias_url= null;
public function __construct()
{
$this->services = new ArrayCollection();
$this->serviceFocusPubs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getPictogrammeVert(): ?string
{
return $this->pictogramme_vert;
}
public function setPictogrammeVert(?string $pictogramme_vert): self
{
$this->pictogramme_vert = $pictogramme_vert;
return $this;
}
public function getPictogrammeBleu(): ?string
{
return $this->pictogramme_bleu;
}
public function setPictogrammeBleu(?string $pictogramme_bleu): self
{
$this->pictogramme_bleu = $pictogramme_bleu;
return $this;
}
/**
* @return Collection|Service[]
*/
public function getServices(): Collection
{
return $this->services;
}
public function addService(Service $service): self
{
if (!$this->services->contains($service)) {
$this->services[] = $service;
$service->addTheme($this);
}
return $this;
}
public function removeService(Service $service): self
{
if ($this->services->removeElement($service)) {
$service->removeTheme($this);
}
return $this;
}
/**
* @return Collection|ServiceFocusPub[]
*/
public function getServiceFocusPubs(): Collection
{
return $this->serviceFocusPubs;
}
public function addServiceFocusPub(ServiceFocusPub $serviceFocusPub): self
{
if (!$this->serviceFocusPubs->contains($serviceFocusPub)) {
$this->serviceFocusPubs[] = $serviceFocusPub;
$serviceFocusPub->addTheme($this);
}
return $this;
}
public function removeServiceFocusPub(ServiceFocusPub $serviceFocusPub): self
{
if ($this->serviceFocusPubs->removeElement($serviceFocusPub)) {
$serviceFocusPub->removeTheme($this);
}
return $this;
}
public function __toString(): string
{
return (string) $this->titre;
}
public function getAliasUrl(): ?string
{
return $this->alias_url;
}
public function setAliasUrl(?string $alias_url): self
{
$this->alias_url = $alias_url;
return $this;
}
}