court_name = $court_name; $this->court_name_cleaned = $court_name_cleaned; $this->court_postcode = $court_postcode; } /** * @ORM\prePersist */ private function setLatLng(PrePersistEventArgs $event) { if ($this->court_latitude < 0.1 && $this->court_longitude < 0.1) { $entityManager = $event->getEntityManager(); $postcodeLatLngRepository = $entityManager->getRepository('PostcodeLatLng'); $postcodeLatLng = $postcodeLatLngRepository->findOneByPostcode($this->getCourt_Postcode()); if ($postcodeLatLng != null) { $this->setCourt_Latitude($postcodeLatLng->getLatitude()); $this->setCourt_Longitude($postcodeLatLng->getLongitude()); } } } public function getId(): ?int { return $this->id; } public function setId(int $id): Court { $this->id = $id; return $this; } public function getCourt_Name(): string { return $this->court_name; } public function setCourt_Name(string $court_name): Court { $this->court_name = $court_name; return $this; } public function getCourt_Name_Cleaned(): string { return $this->court_name_cleaned; } public function setCourt_Name_Cleaned(string $court_name_cleaned): Court { $this->court_name_cleaned = $court_name_cleaned; return $this; } public function getCourt_Postcode(): string { return $this->court_postcode; } public function setCourt_Postcode(string $court_postcode): Court { $this->court_postcode = $court_postcode; return $this; } public function getCourt_Latitude(): float { return $this->court_latitude; } public function setCourt_Latitude(float $court_latitude): Court { $this->court_latitude = $court_latitude; return $this; } public function getCourt_Longitude(): float { return $this->court_longitude; } public function setCourt_Longitude(float $court_longitude): Court { $this->court_longitude = $court_longitude; return $this; } /** * @return Collection */ public function getCourt_Sessions(): Collection { return $this->court_sessions; } }