Example #1
0
 static function createFromData($data)
 {
     $newLocation = new Eden_Google_Latitude_Location();
     $newLocation->setTimestampMs($data['timestampMs']);
     $newLocation->setLatitude($data['latitude']);
     $newLocation->setLongitude($data['longitude']);
     return $newLocation;
 }
Example #2
0
 public function fetch()
 {
     $response = $this->_getResponse(self::URL_LATITUDE_HISTORY, $this->_query);
     if (isset($response['error'])) {
         throw new Eden_Google_Error($response['error']['errors'][0]['message']);
     }
     if (isset($response['data']['items'])) {
         foreach ($response['data']['items'] as $location) {
             $locations[] = Eden_Google_Latitude_Location::createFromData($location);
         }
         return $locations;
     } else {
         return array();
     }
 }