src/Entity/Enjeux.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EnjeuxRepository;
  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(repositoryClass: EnjeuxRepository::class)]
  9. class Enjeux
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\Column(length: 255)]
  16.     private ?string $name = null;
  17.     #[ORM\Column(type: Types::TEXT)]
  18.     private ?string $description = null;
  19.     #[ORM\OneToMany(mappedBy: 'enjeux', targetEntity: Orientation::class)]
  20.     private Collection $orientation;
  21.     #[ORM\ManyToOne(inversedBy: 'enjeuxes')]
  22.     private ?PSG $Psg = null;
  23.     public function __construct()
  24.     {
  25.         $this->orientation = new ArrayCollection();
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getName(): ?string
  32.     {
  33.         return $this->name;
  34.     }
  35.     public function setName(string $name): static
  36.     {
  37.         $this->name = $name;
  38.         return $this;
  39.     }
  40.     public function getDescription(): ?string
  41.     {
  42.         return $this->description;
  43.     }
  44.     public function setDescription(string $description): static
  45.     {
  46.         $this->description = $description;
  47.         return $this;
  48.     }
  49.     /**
  50.      * @return Collection<int, Orientation>
  51.      */
  52.     public function getOrientation(): Collection
  53.     {
  54.         return $this->orientation;
  55.     }
  56.     public function addOrientation(Orientation $orientation): static
  57.     {
  58.         if (!$this->orientation->contains($orientation)) {
  59.             $this->orientation->add($orientation);
  60.             $orientation->setEnjeux($this);
  61.         }
  62.         return $this;
  63.     }
  64.     public function removeOrientation(Orientation $orientation): static
  65.     {
  66.         if ($this->orientation->removeElement($orientation)) {
  67.             // set the owning side to null (unless already changed)
  68.             if ($orientation->getEnjeux() === $this) {
  69.                 $orientation->setEnjeux(null);
  70.             }
  71.         }
  72.         return $this;
  73.     }
  74.     public function getPsg(): ?PSG
  75.     {
  76.         return $this->Psg;
  77.     }
  78.     public function setPsg(?PSG $Psg): static
  79.     {
  80.         $this->Psg = $Psg;
  81.         return $this;
  82.     }
  83.     public function __tostring(): string {
  84.         return $this->name;
  85.     }
  86. }