Class CachedCollection
Extends the schema collection class to provide caching
- Cake\Database\Schema\Collection
- Cake\Database\Schema\CachedCollection
Properties summary
-
$_cache
protectedstring|boolean
The name of the cache config key to use for caching table metadata, of false if disabled.
Inherited Properties
Method Summary
-
__construct() public
Constructor. -
cacheKey() public
Get the cache key for a given name. -
cacheMetadata() public
Sets the cache config name to use for caching table metadata, or disables it if false is passed. If called with no arguments it returns the current configuration name.
-
describe() public
Get the column metadata for a table. -
getCacheMetadata() public
Gets the cache config name to use for caching table metadata, false means disabled. -
setCacheMetadata() public
Sets the cache config name to use for caching table metadata, or disables it if false is passed.
Method Detail
__construct() public ¶
__construct( Cake\Datasource\ConnectionInterface
$connection , string|boolean $cacheKey true )
Constructor.
Parameters
-
Cake\Datasource\ConnectionInterface
$connection - The connection instance.
- string|boolean $cacheKey optional true
- The cache key or boolean false to disable caching.
Overrides
cacheKey() public ¶
cacheKey( string $name )
Get the cache key for a given name.
Parameters
- string $name
- The name to get a cache key for.
Returns
The cache key.
cacheMetadata() public ¶
cacheMetadata( boolean|null $enable null )
Sets the cache config name to use for caching table metadata, or disables it if false is passed. If called with no arguments it returns the current configuration name.
Deprecated
Parameters
- boolean|null $enable optional null
- Whether or not to enable caching
Returns
describe() public ¶
describe( string $name , array $options [] )
Get the column metadata for a table.
Parameters
- string $name
- The name of the table to describe.
- array $options optional []
- The options to use, see above.
Returns
Throws
Overrides
getCacheMetadata() public ¶
getCacheMetadata( )
Gets the cache config name to use for caching table metadata, false means disabled.
Returns
setCacheMetadata() public ¶
setCacheMetadata( boolean $enable )
Sets the cache config name to use for caching table metadata, or disables it if false is passed.
Parameters
- boolean $enable
- Whether or not to enable caching
Returns
$this
Methods inherited from Cake\Database\Schema\Collection
_reflect() protected ¶
_reflect( string $stage , string $name , array $config , Cake\Database\Schema\TableSchema
$schema )
Helper method for running each step of the reflection process.
Parameters
- string $stage
- The stage name.
- string $name
- The table name.
- array $config
- The config data.
-
Cake\Database\Schema\TableSchema
$schema - The table instance
Throws
listTables() public ¶
listTables( )
Get the list of tables available in the current connection.
Returns
The list of tables in the connected database/schema.