Class Collection
Represents a database schema collection
Used to access information about the tables, and other data in a database.
Property Summary
- 
        $_connection protectedCake\Datasource\ConnectionInterfaceConnection object 
- 
        $_dialect protectedCake\Database\Schema\BaseSchemaSchema dialect instance. 
Method Summary
- 
          __construct() publicConstructor. 
- 
          _reflect() protectedHelper method for running each step of the reflection process. 
- 
          describe() publicGet the column metadata for a table. 
- 
          listTables() publicGet the list of tables available in the current connection. 
Method Detail
__construct() ¶ public
__construct(Cake\Datasource\ConnectionInterface $connection)Constructor.
Parameters
- 
                Cake\Datasource\ConnectionInterface$connection
- The connection instance. 
_reflect() ¶ protected
_reflect(string $stage, string $name, array $config, Cake\Database\Schema\Table $table): voidHelper 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\Table$table
- The table instance 
Returns
voidThrows
Cake\Database\Exceptionon query failure.
describe() ¶ public
describe(string $name, array $options = []): Cake\Database\Schema\TableGet 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
- The name of the table to describe. 
- 
                array$options optional
- The options to use, see above. 
Returns
Cake\Database\Schema\TableObject with column metadata.
Throws
Cake\Database\Exceptionwhen table cannot be described.
listTables() ¶ public
listTables(): arrayGet the list of tables available in the current connection.
Returns
arrayThe list of tables in the connected database/schema.
