\Pluf_DB_Schema_SQLite

Generator of the schemas corresponding to a given model.

This class is for SQLite, you can create a class on the same model for another database engine.

Summary

Methods
Properties
Constants
__construct()
getSqlCreate()
getSqlCreateConstraints()
getSqlIndexes()
getSqlDelete()
getSqlDeleteConstraints()
$mappings
$defaults
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$con
N/A

Properties

$mappings

$mappings : 

Mapping of the fields.

Type

$defaults

$defaults : 

Type

$con

$con : 

Type

Methods

__construct()

__construct(  $con) 

Parameters

$con

getSqlCreate()

getSqlCreate(  $model) : array

Get the SQL to generate the tables of the given model.

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.

getSqlCreateConstraints()

getSqlCreateConstraints(  $model) : array

SQLite cannot add foreign key constraints to already existing tables, so we skip their creation completely.

Parameters

$model

Returns

array

getSqlIndexes()

getSqlIndexes(  $model) : array

Get the SQL to generate the indexes of the given model.

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.

getSqlDelete()

getSqlDelete(  $model) : string

Get the SQL to drop the tables corresponding to the model.

Parameters

$model

Returns

string —

SQL string ready to execute.

getSqlDeleteConstraints()

getSqlDeleteConstraints(  $model) : array

SQLite cannot drop foreign keys from existing tables, so we skip their deletion completely.

Parameters

$model

Returns

array