From 0d69b51ff9ef7a111ae251f3e0d1c04227324f2f Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 24 Jan 2025 10:19:43 -0500 Subject: [PATCH] upd: CommunityResource * Add method to convert class to Location object --- src/Entity/CommunityResource.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Entity/CommunityResource.php b/src/Entity/CommunityResource.php index 8d08339..5b7cd23 100644 --- a/src/Entity/CommunityResource.php +++ b/src/Entity/CommunityResource.php @@ -683,4 +683,19 @@ class CommunityResource {$this->getContactCard()} EOL; } + + public function toLocation(): Location + { + $loc = new Location(); + $loc->setName($this->name) + ->setAddress($this->address) + ->setCity($this->city) + ->setState($this->state) + ->setZip($this->zip) + ->setLat($this->lat) + ->setLon($this->lon) + ; + + return $loc; + } }