src/Entity/Dentiste.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DentisteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDentisteRepository::class)]
  8. class Dentiste
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255nullabletrue)]
  15.     private ?string $name null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $description null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $image null;
  20.     #[ORM\OneToMany(mappedBy'dentiste'targetEntityInformation::class)]
  21.     private Collection $information;
  22.     public function __construct()
  23.     {
  24.         $this->information = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getName(): ?string
  31.     {
  32.         return $this->name;
  33.     }
  34.     public function setName(?string $name): static
  35.     {
  36.         $this->name $name;
  37.         return $this;
  38.     }
  39.     public function getDescription(): ?string
  40.     {
  41.         return $this->description;
  42.     }
  43.     public function setDescription(?string $description): static
  44.     {
  45.         $this->description $description;
  46.         return $this;
  47.     }
  48.     public function getImage(): ?string
  49.     {
  50.         return $this->image;
  51.     }
  52.     public function setImage(?string $image): static
  53.     {
  54.         $this->image $image;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, Information>
  59.      */
  60.     public function getInformation(): Collection
  61.     {
  62.         return $this->information;
  63.     }
  64.     public function addInformation(Information $information): static
  65.     {
  66.         if (!$this->information->contains($information)) {
  67.             $this->information->add($information);
  68.             $information->setDentiste($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeInformation(Information $information): static
  73.     {
  74.         if ($this->information->removeElement($information)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($information->getDentiste() === $this) {
  77.                 $information->setDentiste(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82.     public function __toString()
  83.     {
  84.         return $this->name;
  85.     }
  86. }