<?phpnamespace App\Entity;use App\Repository\CommercialRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CommercialRepository::class)]class Commercial{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $fullname = null; #[ORM\Column] private ?\DateTimeImmutable $createdAt = null; #[ORM\Column] private ?\DateTimeImmutable $updatedAt = null; #[ORM\Column(length: 20, nullable: true)] private ?string $tel = null; #[ORM\OneToMany(mappedBy: 'commercial', targetEntity: JobCard::class)] private Collection $jobcards; public function __construct() { $this->jobcards = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getFullname(): ?string { return $this->fullname; } public function setFullname(?string $fullname): static { $this->fullname = $fullname; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } public function getTel(): ?string { return $this->tel; } public function setTel(?string $tel): static { $this->tel = $tel; return $this; } /** * @return Collection<int, JobCard> */ public function getJobcards(): Collection { return $this->jobcards; } public function addJobcard(JobCard $jobcard): static { if (!$this->jobcards->contains($jobcard)) { $this->jobcards->add($jobcard); $jobcard->setCommercial($this); } return $this; } public function removeJobcard(JobCard $jobcard): static { if ($this->jobcards->removeElement($jobcard)) { // set the owning side to null (unless already changed) if ($jobcard->getCommercial() === $this) { $jobcard->setCommercial(null); } } return $this; }}