src/Biz/System/Dao/Impl/CacheDaoImpl.php line 23

Open in your IDE?
  1. <?php
  2. namespace Biz\System\Dao\Impl;
  3. use Biz\System\Dao\CacheDao;
  4. use Codeages\Biz\Framework\Dao\GeneralDaoImpl;
  5. class CacheDaoImpl extends GeneralDaoImpl implements CacheDao
  6. {
  7.     protected $table 'cache';
  8.     public function getByName($name)
  9.     {
  10.         return $this->getByFields(array('name' => $name));
  11.     }
  12.     public function findByNames(array $names)
  13.     {
  14.         if (empty($names)) {
  15.             return array();
  16.         }
  17.         return $this->findInField('name'$names);
  18.     }
  19.     public function updateByName($name$fields)
  20.     {
  21.         $cache $this->getByName($name);
  22.         return $this->update($cache['id'], $fields);
  23.     }
  24.     public function deleteByName($name)
  25.     {
  26.         return $this->db()->delete($this->table, array(
  27.             'name' => $name,
  28.         ));
  29.     }
  30.     public function deleteAll()
  31.     {
  32.         $sql "DELETE FROM {$this->table}";
  33.         $result $this->db()->executeUpdate($sql, array());
  34.         return $result;
  35.     }
  36.     public function declares()
  37.     {
  38.         return array(
  39.         );
  40.     }
  41. }