<?php
namespace App\Entity;
use App\Repository\DentisteRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DentisteRepository::class)]
class Dentiste
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image = null;
#[ORM\OneToMany(mappedBy: 'dentiste', targetEntity: Information::class)]
private Collection $information;
public function __construct()
{
$this->information = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): static
{
$this->image = $image;
return $this;
}
/**
* @return Collection<int, Information>
*/
public function getInformation(): Collection
{
return $this->information;
}
public function addInformation(Information $information): static
{
if (!$this->information->contains($information)) {
$this->information->add($information);
$information->setDentiste($this);
}
return $this;
}
public function removeInformation(Information $information): static
{
if ($this->information->removeElement($information)) {
// set the owning side to null (unless already changed)
if ($information->getDentiste() === $this) {
$information->setDentiste(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
}