src/Entity/Constructeur.php line 11
<?phpnamespace App\Entity;use App\Repository\ConstructeurRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ConstructeurRepository::class)]class Constructeur{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 20)]private ?string $nom = null;#[ORM\OneToMany(mappedBy: 'constructeur', targetEntity: Camion::class)]private Collection $camions;#[ORM\Column(length: 50)]private ?string $telephone = null;public function __construct(){$this->camions = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getNom(): ?string{return $this->nom;}public function setNom(string $nom): static{$this->nom = $nom;return $this;}/*** @return Collection<int, Camion>*/public function getCamions(): Collection{return $this->camions;}public function addCamions(Camion $camion): static{if (!$this->camions->contains($camion)) {$this->camions->add($camion);$camion->setConstructeur($this);}return $this;}public function removeCamions(Camion $camion): static{if ($this->camions->removeElement($camion)) {// set the owning side to null (unless already changed)if ($camion->getConstructeur() === $this) {$camion->setConstructeur(null);}}return $this;}public function __toString(){return $this->getNom();}public function getTelephone(): ?string{return $this->telephone;}public function setTelephone(string $telephone): static{$this->telephone = $telephone;return $this;}}