Skip to main content
Version: Fegg 5.x (next)

Model::alterRenameTo

Execute Alter Rename

Description​

public void Model::alterRenameTo( string $rename )

Renames the model's table. The model keeps the old name; call setTableName to keep using it. Throws Fegg\Database\QueryException when the query fails.

Arguments​

NameData typeDefaultRemarks
$renamestringNew table name

Example​

Controller
$model = new Model(true, array(
'table' => 'sample',
));

// Alter Table "sample" RENAME TO "sample_old"
$model->alterRenameTo('sample_old');