Xpressengine\Database\DatabaseCoupler::getCache PHP Method

getCache() public method

get cache
public getCache ( ) : Xpressengine\Support\CacheInterface
return Xpressengine\Support\CacheInterface
    public function getCache()
    {
        return $this->cache;
    }

Usage Example

コード例 #1
0
 /**
  * set database table schema
  *
  * @param string $table table name
  * @param bool   $force force
  * @return bool
  */
 public function setSchemaCache($table, $force = false)
 {
     $cache = $this->coupler->getCache();
     if ($force === true) {
         $cache->forget($table);
     }
     $schema = $this->getConnection('master')->getSchemaBuilder()->getColumnListing($table);
     if (count($schema) === 0) {
         return false;
     }
     $cache->put($table, $schema);
     return true;
 }