public function getAllChildren(Geo $geo) { if (!$geo->isLoaded()) { return array(); } return $this->findByWhereMany("parentId = '{$geo->getPKValue()}'"); }
public function getNameForLocation(Geo $geo, $lang) { if (!$geo->isLoaded()) { return false; } $this->sql_order = 'isshort DESC, ispreferred DESC'; if ($this->findByWhere("geonameId = '{$geo->getPKValue()}' AND isoLanguage = '{$this->dao->escape($lang)}'")) { return $this->alternatename; } else { return false; } }
/** * returns array of usage counts for all usage types * * @param object $geo * @access public * @return array */ public function getUsageForGeoByType(Geo $geo) { $result = array(); if (!$geo->isLoaded()) { return $result; } $use = $this->findByWhereMany("geoId = '{$geo->getPKValue()}'"); foreach ($this->geo_types as $type) { foreach ($use as $count) { if ($count->typeId = $type->getPKValue()) { $result[$type->name] = $count->count; } } } return $result; }
/** * finds a local group for a geo location * * @param object $geo * @access public * @return object|false */ public function getGroupForGeo(Geo $geo, $local = false) { if (!$geo->isLoaded()) { return false; } return $this->findByWhere("IdGeoname = '{$geo->getPKValue()}'" . ($local ? " AND IsLocal = TRUE" : '')); }