Class CachedCollection
Decorates a schema collection and adds caching
Property Summary
- 
        $cacher protectedPsr\SimpleCache\CacheInterfaceCacher instance. 
- 
        $collection protectedCake\Database\Schema\CollectionInterfaceThe decorated schema collection 
- 
        $prefix protectedstringThe cache key prefix 
Method Summary
- 
          __construct() publicConstructor. 
- 
          cacheKey() publicGet the cache key for a given name. 
- 
          describe() publicGet the column metadata for a table. 
- 
          getCacher() publicGet a cacher. 
- 
          listTables() publicGet the list of tables available in the current connection. 
- 
          listTablesWithoutViews() publicGet the list of tables available in the current connection. This will exclude any views in the schema. 
- 
          setCacher() publicSet a cacher. 
Method Detail
__construct() ¶ public
__construct(Cake\Database\Schema\CollectionInterface $collection, string $prefix, Psr\SimpleCache\CacheInterface $cacher)Constructor.
Parameters
- 
                Cake\Database\Schema\CollectionInterface$collection
- The collection to wrap. 
- 
                string$prefix
- The cache key prefix to use. Typically the connection name. 
- 
                Psr\SimpleCache\CacheInterface$cacher
- Cacher instance. 
cacheKey() ¶ public
cacheKey(string $name): stringGet the cache key for a given name.
Parameters
- 
                string$name
- The name to get a cache key for. 
Returns
stringThe cache key.
describe() ¶ public
describe(string $name, array<string, mixed> $options = []): Cake\Database\Schema\TableSchemaInterfaceGet the column metadata for a table.
Caching will be applied if cacheMetadata key is present in the Connection
configuration options. Defaults to _cakemodel when true.
Options
- forceRefresh- Set to true to force rebuilding the cached metadata. Defaults to false.
Parameters
- 
                string$name
- 
                array<string, mixed>$options optional
Returns
Cake\Database\Schema\TableSchemaInterfacegetCacher() ¶ public
getCacher(): Psr\SimpleCache\CacheInterfaceGet a cacher.
Returns
Psr\SimpleCache\CacheInterface$cacher Cacher object
listTables() ¶ public
listTables(): array<string>Get the list of tables available in the current connection.
Returns
array<string>listTablesWithoutViews() ¶ public
listTablesWithoutViews(): arrayGet the list of tables available in the current connection. This will exclude any views in the schema.
Returns
arraysetCacher() ¶ public
setCacher(Psr\SimpleCache\CacheInterface $cacher): $thisSet a cacher.
Parameters
- 
                Psr\SimpleCache\CacheInterface$cacher
- Cacher object 
Returns
$this