src/Entity/ServiceSousProfil.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ServiceSousProfilRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassServiceSousProfilRepository::class)]
  8. class ServiceSousProfil implements \Stringable
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private int $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private ?string $titrenull;
  16.     #[ORM\ManyToOne(targetEntityServiceGrandProfil::class, inversedBy'serviceSousProfils')]
  17.     private mixed $grandprofil;
  18.     #[ORM\ManyToMany(targetEntityService::class, mappedBy'sousprofils')]
  19.     private mixed $services;
  20.     #[ORM\ManyToMany(targetEntityServiceFocusPub::class, mappedBy'sousprofils')]
  21.     private mixed $serviceFocusPubs;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private ?string $alias_urlnull;
  24.     public function __construct()
  25.     {
  26.         $this->services = new ArrayCollection();
  27.         $this->serviceFocusPubs = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getTitre(): ?string
  34.     {
  35.         return $this->titre;
  36.     }
  37.     public function setTitre(?string $titre): self
  38.     {
  39.         $this->titre $titre;
  40.         return $this;
  41.     }
  42.     public function getGrandprofil(): ?ServiceGrandProfil
  43.     {
  44.         return $this->grandprofil;
  45.     }
  46.     public function setGrandprofil(?ServiceGrandProfil $grandprofil): self
  47.     {
  48.         $this->grandprofil $grandprofil;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Collection|Service[]
  53.      */
  54.     public function getServices(): Collection
  55.     {
  56.         return $this->services;
  57.     }
  58.     public function addService(Service $service): self
  59.     {
  60.         if (!$this->services->contains($service)) {
  61.             $this->services[] = $service;
  62.             $service->addSousprofil($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeService(Service $service): self
  67.     {
  68.         if ($this->services->removeElement($service)) {
  69.             $service->removeSousprofil($this);
  70.         }
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection|ServiceFocusPub[]
  75.      */
  76.     public function getServiceFocusPubs(): Collection
  77.     {
  78.         return $this->serviceFocusPubs;
  79.     }
  80.     public function addServiceFocusPub(ServiceFocusPub $serviceFocusPub): self
  81.     {
  82.         if (!$this->serviceFocusPubs->contains($serviceFocusPub)) {
  83.             $this->serviceFocusPubs[] = $serviceFocusPub;
  84.             $serviceFocusPub->addSousprofil($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeServiceFocusPub(ServiceFocusPub $serviceFocusPub): self
  89.     {
  90.         if ($this->serviceFocusPubs->removeElement($serviceFocusPub)) {
  91.             $serviceFocusPub->removeSousprofil($this);
  92.         }
  93.         return $this;
  94.     }
  95.     public function __toString(): string
  96.     {
  97.         return (string) $this->titre;
  98.     }
  99.     public function getAliasUrl(): ?string
  100.     {
  101.         return $this->alias_url;
  102.     }
  103.     public function setAliasUrl(?string $alias_url): self
  104.     {
  105.         $this->alias_url $alias_url;
  106.         return $this;
  107.     }
  108. }