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;
     }
 }
Beispiel #3
0
 /**
  * returns total usage count for $geo
  *
  * @param object $geo
  * @access public
  * @return int
  */
 public function getAllUsageForGeo(Geo $geo)
 {
     $result = $array();
     if (!$geo->isLoaded()) {
         return 0;
     }
     $use = $this->getUsageForGeoByType($geo);
     $count = 0;
     foreach ($use as $item) {
         $count += $item;
     }
     return $count;
 }
Beispiel #4
0
 /**
  * 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" : ''));
 }