Cake\Database\Connection::cacheMetadata PHP Метод

cacheMetadata() публичный Метод

Changing this setting will not modify existing schema collections objects.
public cacheMetadata ( boolean | string $cache ) : void
$cache boolean | string Either boolean false to disable meta dataing caching, or true to use `_cake_model_` or the name of the cache config to use.
Результат void
    public function cacheMetadata($cache)
    {
        $this->_schemaCollection = null;
        $this->_config['cacheMetadata'] = $cache;
    }

Usage Example

Пример #1
2
 /**
  * Constructor
  *
  * @param \Phinx\Db\Adapter\AdapterInterface $adapter The original adapter to decorate.
  * @param \Cake\Database\Connection $connection The connection to actually use.
  */
 public function __construct(AdapterInterface $adapter, Connection $connection)
 {
     $this->adapter = $adapter;
     $this->connection = $connection;
     $pdo = $adapter->getConnection();
     if ($pdo->getAttribute(PDO::ATTR_ERRMODE) !== PDO::ERRMODE_EXCEPTION) {
         $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     }
     $connection->cacheMetadata(false);
     $connection->driver()->connection($pdo);
 }
All Usage Examples Of Cake\Database\Connection::cacheMetadata