DboMysqlBase Class Reference

Inheritance diagram for DboMysqlBase:

DboSource DataSource Object DboMysql DboMysqli List of all members.

Public Member Functions

 _alterIndexes ($table, $indexes)
 alterSchema ($compare, $table=null)
 delete (&$model, $conditions=null)
 dropSchema ($schema, $table=null)
 index ($model)
 insertMulti ($table, $fields, $values)
 setEncoding ($enc)
 update (&$model, $fields=array(), $values=null, $conditions=null)

Public Attributes

 $_commands
 $_useAlias = true
 $columns
 $description = "MySQL DBO Base Driver"
 $endQuote = "`"
 $startQuote = "`"

Detailed Description

Definition at line 33 of file dbo_mysql.php.


Member Function Documentation

DboMysqlBase::_alterIndexes ( table,
indexes 
)

Generate MySQL index alteration statements for a table.

Parameters:
string $table Table to alter indexes for
array $new Indexes to add and drop
Returns:
array Index alteration statements

Definition at line 283 of file dbo_mysql.php.

References $out, DataSource::column(), and DboSource::name().

Referenced by alterSchema().

DboMysqlBase::alterSchema ( compare,
table = null 
)

Generate a MySQL Alter Table syntax for the given Schema comparison

Parameters:
array $compare Result of a CakeSchema::compare()
Returns:
array Array of alter statements to make.

Reimplemented from DboSource.

Definition at line 207 of file dbo_mysql.php.

References $out, _alterIndexes(), DboSource::buildColumn(), DboSource::fullTableName(), and DboSource::name().

DboMysqlBase::delete ( &$  model,
conditions = null 
)

Generates and executes an SQL DELETE statement for given id/conditions on given model.

Parameters:
Model $model
mixed $conditions
Returns:
boolean Success

Reimplemented from DboSource.

Definition at line 138 of file dbo_mysql.php.

References DboSource::$alias, DboSource::_getJoins(), DboSource::conditions(), DboSource::defaultConditions(), delete(), DboSource::execute(), DboSource::fullTableName(), DboSource::name(), and DboSource::renderStatement().

DboMysqlBase::dropSchema ( schema,
table = null 
)

Generate a MySQL "drop table" statement for the given Schema object

Parameters:
object $schema An instance of a subclass of CakeSchema
string $table Optional. If specified only the table name given will be generated. Otherwise, all tables defined in the schema are generated.
Returns:
string

Reimplemented from DboSource.

Definition at line 263 of file dbo_mysql.php.

References $columns, $out, __(), and DboSource::fullTableName().

DboMysqlBase::index ( model  ) 

Returns an array of the indexes in given datasource name.

Parameters:
string $model Name of model to inspect
Returns:
array Fields in table. Keys are column and unique

Reimplemented from DboSource.

Definition at line 175 of file dbo_mysql.php.

References DboSource::$index, DataSource::column(), Set::extract(), DboSource::fullTableName(), and DboSource::query().

Referenced by DboMysqli::describe(), and DboMysql::describe().

DboMysqlBase::insertMulti ( table,
fields,
values 
)

Inserts multiple values into a table

Parameters:
string $table
string $fields
array $values

Reimplemented from DboSource.

Definition at line 324 of file dbo_mysql.php.

References DboSource::fullTableName(), DboSource::name(), and DboSource::query().

DboMysqlBase::setEncoding ( enc  ) 

Sets the database encoding

Parameters:
string $enc Database encoding

Definition at line 166 of file dbo_mysql.php.

Referenced by DboMysqli::connect(), and DboMysql::connect().

DboMysqlBase::update ( &$  model,
fields = array(),
values = null,
conditions = null 
)

Generates and executes an SQL UPDATE statement for given model, fields, and values.

Parameters:
Model $model
array $fields
array $values
mixed $conditions
Returns:
array

Reimplemented from DboSource.

Definition at line 97 of file dbo_mysql.php.

References DboSource::$alias, DboSource::_getJoins(), DboSource::_prepareUpdateFields(), DboSource::conditions(), DboSource::defaultConditions(), DboSource::execute(), DboSource::fields(), DboSource::fullTableName(), DboSource::name(), and DboSource::renderStatement().


Member Data Documentation

DboMysqlBase::$_commands

Initial value:

 array(
        'begin'    => 'START TRANSACTION',
        'commit'   => 'COMMIT',
        'rollback' => 'ROLLBACK'
    )

Reimplemented from DboSource.

Definition at line 65 of file dbo_mysql.php.

DboMysqlBase::$_useAlias = true

Definition at line 58 of file dbo_mysql.php.

DboMysqlBase::$columns

Initial value:

 array(
        'primary_key' => array('name' => 'NOT NULL AUTO_INCREMENT'),
        'string' => array('name' => 'varchar', 'limit' => '255'),
        'text' => array('name' => 'text'),
        'integer' => array('name' => 'int', 'limit' => '11', 'formatter' => 'intval'),
        'float' => array('name' => 'float', 'formatter' => 'floatval'),
        'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
        'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
        'time' => array('name' => 'time', 'format' => 'H:i:s', 'formatter' => 'date'),
        'date' => array('name' => 'date', 'format' => 'Y-m-d', 'formatter' => 'date'),
        'binary' => array('name' => 'blob'),
        'boolean' => array('name' => 'tinyint', 'limit' => '1')
    )

Definition at line 75 of file dbo_mysql.php.

Referenced by dropSchema().

DboMysqlBase::$description = "MySQL DBO Base Driver"

Reimplemented from DboSource.

Reimplemented in DboMysql, and DboMysqli.

Definition at line 39 of file dbo_mysql.php.

DboMysqlBase::$endQuote = "`"

Reimplemented from DataSource.

Definition at line 51 of file dbo_mysql.php.

DboMysqlBase::$startQuote = "`"

Reimplemented from DataSource.

Definition at line 45 of file dbo_mysql.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:55 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7