<?php
final class OfferRemarkDao extends Dao {
  private static $ALL = <<<'SQL'
select offer_code,
       remark
  from offer_remark
 order by offer_code,
       remark
SQL;
  private static $PK = <<<'SQL'
select offer_code,
       remark
  from offer_remark
 where offer_code = '%s'
   and remark = '%s'
SQL;
  private static $OFFER_CODE = <<<'SQL'
select offer_code,
       remark
  from offer_remark
 where offer_code = '%s'
 order by null
SQL;
  private static $DELETE = <<<'SQL'
delete from offer_remark
 where offer_code = '%s'
SQL;
  private static $INSERT = <<<'SQL'
replace into offer_remark
             (offer_code,
              remark)
      values ('%s',
              '%s')
SQL;
  public function getAll() {
    return $this->execute(self::$ALL);
  }
  public function getByPk($pk) {
    return $this->execute(self::$PK, $pk);
  }
  public function getByOfferCode($offerCode) {
    return $this->execute(self::$OFFER_CODE, $offerCode);
  }
  public function delete($offerCode) {
    return $this->execute(self::$DELETE, $offerCode);
  }
  public function insert($offerCode, $remarkName) {
    $this->execute(self::$INSERT, array($offerCode, $remarkName));
  }
}
// EOF.
