Pluf_DB_Schema_MySQL Class Reference

List of all members.

Public Member Functions

 __construct ($con)
 getSqlCreate ($model)
 getSqlIndexes ($model)
 getSqlDelete ($model)

Public Attributes

 $mappings
 $defaults

Private Attributes

 $con = null


Detailed Description

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.


Constructor & Destructor Documentation

Pluf_DB_Schema_MySQL::__construct ( con  ) 


Member Function Documentation

Pluf_DB_Schema_MySQL::getSqlCreate ( model  ) 

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

Parameters:
Object Model
Returns:
array Array of SQL strings ready to execute.

Pluf_DB_Schema_MySQL::getSqlIndexes ( model  ) 

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

Parameters:
Object Model
Returns:
array Array of SQL strings ready to execute.

Pluf_DB_Schema_MySQL::getSqlDelete ( model  ) 

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

Parameters:
Object Model
Returns:
string SQL string ready to execute.


Member Data Documentation

Pluf_DB_Schema_MySQL::$mappings

Initial value:

 array(
                             'varchar' => 'varchar(%s)',
                             'sequence' => 'mediumint(9) unsigned not null auto_increment',
                             'boolean' => 'bool',
                             'date' => 'date',
                             'datetime' => 'datetime',
                             'file' => 'varchar(150)',
                             'manytomany' => null,
                             'foreignkey' => 'mediumint(9) unsigned',
                             'text' => 'longtext',
                             'html' => 'longtext',
                             'time' => 'time',
                             'integer' => 'integer',
                             'email' => 'varchar(150)',
                             'password' => 'varchar(150)',
                             'float' => 'numeric(%s, %s)',
                             'blob' => 'blob',
                             )
Mapping of the fields.

Pluf_DB_Schema_MySQL::$defaults

Initial value:

 array(
                             'varchar' => "''",
                             'sequence' => null,
                             'boolean' => 1,
                             'date' => 0,
                             'datetime' => 0,
                             'file' => "''",
                             'manytomany' => null,
                             'foreignkey' => 0,
                             'text' => "''",
                             'html' => "''",
                             'time' => 0,
                             'integer' => 0,
                             'email' => "''",
                             'password' => "''",
                             'float' => 0.0,
                             'blob' => "''",
                             )

Pluf_DB_Schema_MySQL::$con = null [private]


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:51 2010 for Pluf by  doxygen