Beispiel #1
0
 /**
  * (non-PHPdoc)
  * @see \Koldy\Cache\Driver\AbstractCacheDriver::has()
  */
 public function has($key)
 {
     $this->checkKey($key);
     $select = new Select($this->config['table']);
     $select->setConnection($this->config['connection']);
     $select->field('expires_at')->where('id', $key);
     $cacheRecord = $select->fetchFirst();
     if ($cacheRecord === false) {
         return false;
     }
     return $cacheRecord['expires_at'] > time();
 }
Beispiel #2
0
 /**
  * Get the initialized Select object with populated FROM part
  * 
  * @return \Koldy\Db\Select
  */
 public static function query()
 {
     $select = new Select(static::getTableName());
     $select->setConnection(static::$connection);
     return $select;
 }