*/ #[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'company')] private Collection $employees; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Announcement::class, mappedBy: 'company')] private Collection $announcements; public function __construct() { $this->employees = new ArrayCollection(); $this->announcements = 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 getAddress(): ?string { return $this->address; } public function setAddress(string $address): static { $this->address = $address; return $this; } public function getTel(): ?string { return $this->tel; } public function setTel(string $tel): static { $this->tel = $tel; return $this; } public function getMail(): ?string { return $this->mail; } public function setMail(string $mail): static { $this->mail = $mail; return $this; } /** * @return Collection */ public function getEmployees(): Collection { return $this->employees; } public function addEmployee(Employee $employee): static { if (!$this->employees->contains($employee)) { $this->employees->add($employee); $employee->setCompany($this); } return $this; } public function removeEmployee(Employee $employee): static { if ($this->employees->removeElement($employee)) { // set the owning side to null (unless already changed) if ($employee->getCompany() === $this) { $employee->setCompany(null); } } return $this; } /** * @return Collection */ public function getAnnouncements(): Collection { return $this->announcements; } public function addAnnouncement(Announcement $announcement): static { if (!$this->announcements->contains($announcement)) { $this->announcements->add($announcement); $announcement->setCompany($this); } return $this; } public function removeAnnouncement(Announcement $announcement): static { if ($this->announcements->removeElement($announcement)) { // set the owning side to null (unless already changed) if ($announcement->getCompany() === $this) { $announcement->setCompany(null); } } return $this; } }