Class Collection

Represents a database schema collection

Used to access information about the tables, and other data in a database.

Direct known subclasses

Cake\Database\Schema\CachedCollection

Method Detail

__constructsource public

__construct( Cake\Datasource\ConnectionInterface $connection )

Constructor.

Parameters

Cake\Datasource\ConnectionInterface $connection
The connection instance.

_reflectsource protected

_reflect( string $stage , string $name , array $config , Cake\Database\Schema\Table $table )

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\Table $table
The table instance

Throws

Cake\Database\Exception
on query failure.

describesource public

describe( string $name , array $options [] )

Get the column metadata for a table.

Caching will be applied if cacheMetadata key is present in the Connection configuration options. Defaults to _cake_model_ 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\Table
Object with column metadata.

Throws

Cake\Database\Exception
when table cannot be described.

listTablessource public

listTables( )

Get the list of tables available in the current connection.

Returns

array
The list of tables in the connected database/schema.

Properties summary

$_connectionsource

protected Cake\Datasource\ConnectionInterface

Connection object

$_dialectsource

protected Cake\Database\Schema\BaseSchema

Schema dialect instance.

© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Database.Schema.Collection.html