<?php
final class CityDao extends Dao {
  private static $ALL = <<<'SQL'
select prefecture_id,
       city_id,
       city_name
  from city
 order by city_id
SQL;
  private static $PK = <<<'SQL'
select prefecture_id,
       city_id,
       city_name
  from city
 where prefecture_id = '%s'
   and city_id = '%s'
SQL;
  private static $PREFECTURE_ID = <<<'SQL'
select prefecture_id,
       city_id,
       city_name
  from city
 where prefecture_id = '%s'
 order by city_id
SQL;
  public function getAll() {
    return $this->execute(self::$ALL);
  }
  public function getByPk($pk) {
    return $this->execute(self::$PK, $pk);
  }
  public function getByPrefectureId($key) {
    return $this->execute(self::$PREFECTURE_ID, $key);
  }
}
// EOF.
