Skip to content

Working With Schema API

Yo-An Lin edited this page May 15, 2017 · 1 revision

Manipulating Schema Objects

To get the model class name from a schema:

$class = $schema->getModelClass();

To get the table name of a schema:

$t = $schema->getTable();

To iterate the column objects, you may call getColumns, which returns the column objects in an associative array:

foreach( $schema->getColumns() as $n => $c ) {
    echo $c->name; // column name
}

Clone this wiki locally