CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.9 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.9
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
      • Dialect
      • Driver
      • Exception
      • Expression
      • Log
      • Retry
      • Schema
      • Statement
      • Type
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class CachedCollection

Extends the schema collection class to provide caching

Namespace: Cake\Database\Schema

Property Summary

  • $_cache protected
    string|bool

    The name of the cache config key to use for caching table metadata, of false if disabled.

  • $_connection protected
    Cake\Database\Connection

    Connection object

  • $_dialect protected
    Cake\Database\Schema\BaseSchema

    Schema dialect instance.

Method Summary

  • __construct() public

    Constructor.

  • _reflect() protected

    Helper method for running each step of the reflection process.

  • cacheKey() public

    Get the cache key for a given name.

  • cacheMetadata() public deprecated

    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.

  • listTables() public

    Get the list of tables available in the current connection.

  • 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|bool $cacheKey = true)

Constructor.

Parameters
Cake\Datasource\ConnectionInterface $connection

The connection instance.

string|bool $cacheKey optional

The cache key or boolean false to disable caching.

_reflect() ¶ protected

_reflect(string $stage, string $name, array $config, Cake\Database\Schema\TableSchemaInterface $schema): void

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\TableSchemaInterface $schema

The table schema instance.

Returns
void
Throws
Cake\Database\Exception
on query failure.

cacheKey() ¶ public

cacheKey(string $name): string

Get the cache key for a given name.

Parameters
string $name

The name to get a cache key for.

Returns
string

cacheMetadata() ¶ public

cacheMetadata(bool|null $enable = null): string|bool

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.

Parameters
bool|null $enable optional

Whether or not to enable caching

Returns
string|bool

describe() ¶ public

describe(string $name, array $options = []): Cake\Database\Schema\TableSchema

Get the column metadata for a table.

The name can include a database schema name in the form 'schema.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 $options optional
Returns
Cake\Database\Schema\TableSchema

getCacheMetadata() ¶ public

getCacheMetadata(): string|bool

Gets the cache config name to use for caching table metadata, false means disabled.

Returns
string|bool

listTables() ¶ public

listTables(): string[]

Get the list of tables available in the current connection.

Returns
string[]

setCacheMetadata() ¶ public

setCacheMetadata(bool $enable): $this

Sets the cache config name to use for caching table metadata, or disables it if false is passed.

Parameters
bool $enable

Whether or not to enable caching

Returns
$this

Property Detail

$_cache ¶ protected

The name of the cache config key to use for caching table metadata, of false if disabled.

Type
string|bool

$_connection ¶ protected

Connection object

Type
Cake\Database\Connection

$_dialect ¶ protected

Schema dialect instance.

Type
Cake\Database\Schema\BaseSchema
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs