<?php
final class TopicDao extends Dao {
  private static $ALL = <<<'SQL'
select topic_id,
       topic
  from topic
SQL;
  private static $PK = <<<'SQL'
select topic_id,
       topic
  from topic
 where topic_id = %s
SQL;
  private static $UPDATE = <<<'SQL'
update topic
   set topic = '%s'
 where topic_id = %s
SQL;
  public function getAll() {
    return $this->execute(self::$ALL);
  }
  public function getByPk($pk) {
    return $this->execute(self::$PK, $pk);
  }
  public function update($topic, $id) {
    return $this->execute(self::$UPDATE, array($topic, $id));
  }
}
// EOF.
