uuid = Uuid::v4()->toRfc4122(); $this->doctor = $doctor; $this->createdAt = time(); $this->updatedAt = time(); } public function getId(): ?int { return $this->id; } public function getUuid(): string { return $this->uuid; } public function getDoctor(): Doctor { return $this->doctor; } public function getName(): ?string { return $this->name; } public function getAddress(): ?string { return $this->address; } public function getTelephone(): ?string { return $this->telephone; } public function getLatitude(): ?float { return $this->latitude; } public function getLongitude(): ?float { return $this->longitude; } public function setName(?string $v): self { $this->name = $v; return $this; } public function setAddress(?string $v): self { $this->address = $v; $this->touch(); return $this; } public function setTelephone(?string $v): self { $this->telephone = $v; $this->touch(); return $this; } public function setLatitude(?float $v): self { $this->latitude = $v; $this->touch(); return $this; } public function setLongitude(?float $v): self { $this->longitude = $v; $this->touch(); return $this; } private function touch(): void { $this->updatedAt = time(); } public function toArray(): array { return [ 'id' => (string) $this->id, 'uuid' => $this->uuid, 'name' => $this->name, 'map' => [ 'latitude' => $this->latitude !== null ? (string) $this->latitude : null, 'longitude' => $this->longitude !== null ? (string) $this->longitude : null, ], 'address' => $this->address, 'telephone' => $this->telephone, ]; } }