src/Entity/Service.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ServiceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassServiceRepository::class)]
  9. #[ORM\InheritanceType(value'JOINED')]
  10. #[ORM\DiscriminatorColumn(name'type'type'string')]
  11. #[ORM\DiscriminatorMap(value: ['InterventionEntrepriseService' => InterventionEntrepriseService::class,'FormationsService' => FormationsService::class, 'ProgrammeFormationService' => ProgrammeFormationService::class, 'OtherService' => OtherService::class
  12. ])]
  13. class Service
  14. {
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column(type'integer')]
  18.     private $id;
  19.     #[ORM\Column(length255)]
  20.     private ?string $axe null;
  21.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  22.     private ?string $description null;
  23. //    #[ORM\Column(type: Types::TEXT)]
  24. //    private ?string $details = null;
  25.     #[ORM\OneToMany(mappedBy'service'targetEntityRubrique::class, orphanRemovaltrue)]
  26.     private Collection $rubriques;
  27.     public function __construct()
  28.     {
  29.         $this->rubriques = new ArrayCollection();
  30.     }
  31.     public function __toString()
  32.     {
  33.         return $this->axe;
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getAxe(): ?string
  40.     {
  41.         return $this->axe;
  42.     }
  43.     public function setAxe(string $axe): self
  44.     {
  45.         $this->axe $axe;
  46.         return $this;
  47.     }
  48.     public function getDescription(): ?string
  49.     {
  50.         return $this->description;
  51.     }
  52.     public function setDescription(string $description): self
  53.     {
  54.         $this->description $description;
  55.         return $this;
  56.     }
  57. //    public function getDetails(): ?string
  58. //    {
  59. //        return $this->details;
  60. //    }
  61. //
  62. //    public function setDetails(string $details): self
  63. //    {
  64. //        $this->details = $details;
  65. //
  66. //        return $this;
  67. //    }
  68.     /**
  69.      * @return Collection<int, Rubrique>
  70.      */
  71.     public function getRubriques(): Collection
  72.     {
  73.         return $this->rubriques;
  74.     }
  75.     public function addRubrique(Rubrique $rubrique): self
  76.     {
  77.         if (!$this->rubriques->contains($rubrique)) {
  78.             $this->rubriques->add($rubrique);
  79.             $rubrique->setService($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeRubrique(Rubrique $rubrique): self
  84.     {
  85.         if ($this->rubriques->removeElement($rubrique)) {
  86.             // set the owning side to null (unless already changed)
  87.             if ($rubrique->getService() === $this) {
  88.                 $rubrique->setService(null);
  89.             }
  90.         }
  91.         return $this;
  92.     }
  93. }