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
protectedSchema
Method Summary
-
__construct() public
Constructor -
build() public
Build metadata. -
clear() public
Clear metadata. -
getSchema() public
Helper method to get the schema collection.
Method Detail
__construct() 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() 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
array
Returns a list build table caches
Returns a list build table caches
clear() 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
array
Returns a list of cleared table caches
Returns a list of cleared table caches
getSchema() public ¶
getSchema( Cake\Database\Connection
$connection )
Helper method to get the schema collection.
Parameters
-
Cake\Database\Connection
$connection - Connection object
Returns
Throws
RuntimeException
If given connection object is not compatible with schema caching
If given connection object is not compatible with schema caching