/** * get the nearest locations by city * * @param string $city * @param string $model * @param integer $limit * @param integer $offset * @return array * @author Andy Bennett */ public function nearest_city_locations($city, $model, $limit = null, $offset = null) { $ll = latlon::latlon_from_city($city); if ($ll == false or empty($ll->latitude) or empty($ll->longitude)) { return false; } Kohana::config_set('distance.lat', $ll->latitude); Kohana::config_set('distance.lon', $ll->longitude); return ORM::factory($model)->find_all($limit, $offset); }