\Pluf_DB_Schema_MySQL

Generator of the schemas corresponding to a given model.

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

Summary

Methods
Properties
Constants
__construct()
getSqlCreate()
getSqlIndexes()
getShortenedFKeyName()
getSqlCreateConstraints()
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(Object  $con) 

Creates new instance

Parameters

Object $con

getSqlCreate()

getSqlCreate(\Pluf_Model  $model) : array<mixed,string>

Creates sql for DB

Parameters

\Pluf_Model $model

Returns

array<mixed,string>

getSqlIndexes()

getSqlIndexes(  $model) : array

دستور معادل برای ایجاد اندیس‌ها را تولید می‌کند.

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.

getShortenedFKeyName()

getShortenedFKeyName(  $name) : string

Workaround for <http://bugs.mysql.com/bug.php?id=13942> which limits the length of foreign key identifiers to 64 characters.

Parameters

$name

Returns

string

getSqlCreateConstraints()

getSqlCreateConstraints(  $model) : array

Get the SQL to create the constraints for 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

Get the SQL to drop the constraints for the given model

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.