Skip to content

Instantly share code, notes, and snippets.

@raekul
Created June 29, 2017 09:30
Show Gist options
  • Save raekul/dc8cc29034bcdcc8fa4f0c3452c094d4 to your computer and use it in GitHub Desktop.
Save raekul/dc8cc29034bcdcc8fa4f0c3452c094d4 to your computer and use it in GitHub Desktop.
<?php
class blah extends blah {
public function getDetails($place_id)
{
$googlePlaces = new PlacesApi($this->key);
try {
$this->response = $googlePlaces->placeDetails($place_id);
if ($googlePlaces->getStatus() !== "OK") {
throw new Exception('Places API returned an invalid response');
}
} catch (Exception $e) {
Mage::logException($e);
}
// We get an Illuminate/Collection so we have access to those methods
return $this->response->get('result');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment