Class SchemaCache
Schema Cache.
This tool is intended to be used by deployment scripts so that you can prevent thundering herd effects on the metadata cache when new versions of your application are deployed, or when migrations requiring updated metadata are required.
Properties summary
-
$_schema
protected
Method Summary
- __construct() publicConstructor
- build() publicBuild metadata.
- clear() publicClear metadata.
- getSchema() publicHelper method to get the schema collection.
Method Detail
__construct()source public
__construct( string|Cake\Datasource\ConnectionInterface $connection )
Constructor
Parameters
- string|
Cake\Datasource\ConnectionInterface
$connection
- Connection name to get the schema for or a connection instance
build()source public
build( string|null $name = null )
Build metadata.
Parameters
- string|null
$name
optional null - The name of the table to build cache data for.
Returns
arrayReturns a list build table caches
clear()source public
clear( string|null $name = null )
Clear metadata.
Parameters
- string|null
$name
optional null - The name of the table to clear cache data for.
Returns
arrayReturns a list of cleared table caches
getSchema()source public
getSchema( Cake\Database\Connection $connection )
Helper method to get the schema collection.
Parameters
-
Cake\Database\Connection
$connection
- Connection object
Returns
Cake\Database\Schema\Collection
|Cake\Database\Schema\CachedCollection
Throws
RuntimeExceptionIf given connection object is not compatible with schema caching
Properties detail
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.6/class-Cake.Database.SchemaCache.html