diff --git a/src/TgBotLib/Objects/BusinessLocation.php b/src/TgBotLib/Objects/BusinessLocation.php new file mode 100644 index 0000000..3ad965b --- /dev/null +++ b/src/TgBotLib/Objects/BusinessLocation.php @@ -0,0 +1,59 @@ +address; + } + + /** + * Optional. Location of the business + * + * @return Location|null + */ + public function getLocation(): ?Location + { + return $this->location; + } + + /** + * @inheritDoc + */ + public function toArray(): ?array + { + return [ + 'address' => $this->address, + 'location' => $this->location?->toArray() + ]; + } + + /** + * @inheritDoc + */ + public static function fromArray(?array $data): ?BusinessLocation + { + if($data === null) + { + return null; + } + + $object = new self(); + $object->address = $data['address']; + $object->location = isset($data['location']) ? Location::fromArray($data['location']) : null; + + return $object; + } + } \ No newline at end of file