src/Entity/ServiceGrandProfil.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ServiceGrandProfilRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassServiceGrandProfilRepository::class)]
  8. class ServiceGrandProfil 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\OneToMany(targetEntityServiceSousProfil::class, mappedBy'grandprofil')]
  17.     private mixed $serviceSousProfils;
  18.     #[ORM\ManyToMany(targetEntityService::class, mappedBy'grandprofils')]
  19.     private mixed $services;
  20.     #[ORM\ManyToMany(targetEntityServiceFocusPub::class, mappedBy'grandprofils')]
  21.     private mixed $serviceFocusPubs;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private ?string $alias_urlnull;
  24.     public function __construct()
  25.     {
  26.         $this->serviceSousProfils = new ArrayCollection();
  27.         $this->services = new ArrayCollection();
  28.         $this->serviceFocusPubs = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getTitre(): ?string
  35.     {
  36.         return $this->titre;
  37.     }
  38.     public function setTitre(?string $titre): self
  39.     {
  40.         $this->titre $titre;
  41.         return $this;
  42.     }
  43.     /**
  44.      * @return Collection|ServiceSousProfil[]
  45.      */
  46.     public function getServiceSousProfils(): Collection
  47.     {
  48.         return $this->serviceSousProfils;
  49.     }
  50.     public function addServiceSousProfil(ServiceSousProfil $serviceSousProfil): self
  51.     {
  52.         if (!$this->serviceSousProfils->contains($serviceSousProfil)) {
  53.             $this->serviceSousProfils[] = $serviceSousProfil;
  54.             $serviceSousProfil->setGrandprofil($this);
  55.         }
  56.         return $this;
  57.     }
  58.     public function removeServiceSousProfil(ServiceSousProfil $serviceSousProfil): self
  59.     {
  60.         if ($this->serviceSousProfils->removeElement($serviceSousProfil)) {
  61.             // set the owning side to null (unless already changed)
  62.             if ($serviceSousProfil->getGrandprofil() === $this) {
  63.                 $serviceSousProfil->setGrandprofil(null);
  64.             }
  65.         }
  66.         return $this;
  67.     }
  68.     /**
  69.      * @return Collection|Service[]
  70.      */
  71.     public function getServices(): Collection
  72.     {
  73.         return $this->services;
  74.     }
  75.     public function addService(Service $service): self
  76.     {
  77.         if (!$this->services->contains($service)) {
  78.             $this->services[] = $service;
  79.             $service->addGrandprofil($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeService(Service $service): self
  84.     {
  85.         if ($this->services->removeElement($service)) {
  86.             $service->removeGrandprofil($this);
  87.         }
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return Collection|ServiceFocusPub[]
  92.      */
  93.     public function getServiceFocusPubs(): Collection
  94.     {
  95.         return $this->serviceFocusPubs;
  96.     }
  97.     public function addServiceFocusPub(ServiceFocusPub $serviceFocusPub): self
  98.     {
  99.         if (!$this->serviceFocusPubs->contains($serviceFocusPub)) {
  100.             $this->serviceFocusPubs[] = $serviceFocusPub;
  101.             $serviceFocusPub->addGrandprofil($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeServiceFocusPub(ServiceFocusPub $serviceFocusPub): self
  106.     {
  107.         if ($this->serviceFocusPubs->removeElement($serviceFocusPub)) {
  108.             $serviceFocusPub->removeGrandprofil($this);
  109.         }
  110.         return $this;
  111.     }
  112.     public function __toString(): string
  113.     {
  114.         return (string) $this->titre;
  115.     }
  116.     public function getAliasUrl(): ?string
  117.     {
  118.         return $this->alias_url;
  119.     }
  120.     public function setAliasUrl(?string $alias_url): self
  121.     {
  122.         $this->alias_url $alias_url;
  123.         return $this;
  124.     }
  125. }