class GeonamesPlugin extends Plugin
{
- const NAMESPACE = 1;
+ const LOCATION_NS = 1;
/**
* convert a name into a Location object
$location->lon = $n->lng;
$location->names[$language] = $n->name;
$location->location_id = $n->geonameId;
- $location->location_ns = self::NAMESPACE;
+ $location->location_ns = self::LOCATION_NS;
// handled, don't continue processing!
return false;
function onLocationFromId($id, $ns, $language, &$location)
{
- if ($ns != self::NAMESPACE) {
+ if ($ns != self::LOCATION_NS) {
// It's not one of our IDs... keep processing
return true;
}
$location = new Location();
$location->location_id = $last->geonameId;
- $location->location_ns = self::NAMESPACE;
+ $location->location_ns = self::LOCATION_NS;
$location->lat = $last->lat;
$location->lon = $last->lng;
$location->names[$language] = implode(', ', array_reverse($parts));
}
$location->location_id = $n->geonameId;
- $location->location_ns = self::NAMESPACE;
+ $location->location_ns = self::LOCATION_NS;
$location->lat = $lat;
$location->lon = $lon;
function onLocationNameLanguage($location, $language, &$name)
{
- if ($location->location_ns != self::NAMESPACE) {
+ if ($location->location_ns != self::LOCATION_NS) {
// It's not one of our IDs... keep processing
return true;
}
function onLocationUrl($location, &$url)
{
- if ($location->location_ns != self::NAMESPACE) {
+ if ($location->location_ns != self::LOCATION_NS) {
// It's not one of our IDs... keep processing
return true;
}
static public function locationIds()
{
- return array(array(6077243, GeonamesPlugin::NAMESPACE, 'en', null),
- array(5391959, GeonamesPlugin::NAMESPACE, 'en', null));
+ return array(array(6077243, GeonamesPlugin::LOCATION_NS, 'en', null),
+ array(5391959, GeonamesPlugin::LOCATION_NS, 'en', null));
}
/**