eZPublish  3.8
eZMysqlSchema Class Reference

Handles schemas for MySQL. More...

+ Inheritance diagram for eZMysqlSchema:
+ Collaboration diagram for eZMysqlSchema:

Public Member Functions

 escapeSQLString ($value)
 
 eZMysqlSchema ($params)
 
 generateTableOption ($tableName, $tableDef, $optionType, $optionValue, $params)
 
 generateTableSchema ($tableName, $table, $params)
 
 generateTableSQLList ($tableName, $table, $params, $separateTypes)
 
 isMultiInsertSupported ()
 
 parseType ($type_info, &$length_info)
 
 schema ($params=array())
 
 schemaName ()
 
 schemaType ()
 
 tableCharsetName ($charset)
 
 tableStorageTypeName ($type)
 
- Public Member Functions inherited from eZDBSchemaInterface
 appendSQLComments ($def, &$sql)
 
 data ($schema=false, $tableNameList=false, $params=array())
 
 eZDBSchemaInterface ($params)
 
 insertSchema ($params=array())
 
 validate ()
 
 writeArraySchemaFile ($filename, $params=array())
 
 writeSerializedSchemaFile ($filename, $params=array())
 
 writeSQLSchemaFile ($filename, $params=array())
 
 writeUpgradeFile ($differences, $filename, $params=array())
 

Private Member Functions

 fetchTableFields ($table, $params)
 
 fetchTableIndexes ($table, $params)
 
 generateAddFieldSql ($table_name, $field_name, $def, $params)
 
 generateAddIndexSql ($table_name, $index_name, $def, $params, $isEmbedded=false)
 
 generateAlterFieldSql ($table_name, $field_name, $def=array())
 
 generateDropIndexSql ($table_name, $index_name, $def, $params)
 
 generateDropTable ($table, $params)
 
 generateFieldDef ($field_name, $def, &$skip_primary, $params=null)
 
 generateTableSQL ($tableName, $tableDef, $params, $asArray, $separateTypes=false)
 

Additional Inherited Members

- Public Attributes inherited from eZDBSchemaInterface
 $Data
 
 $DBInstance
 eZDB instance More...
 
 $Schema
 
- Protected Member Functions inherited from eZDBSchemaInterface
 fetchTableData ($tableInfo, $offset=false, $limit=false)
 
 generateAddFieldSql ($table_name, $field_name, $def)
 
 generateDataValueTextSQL ($fieldDef, $value)
 
 generateTableInsert ($tableName, $tableDef, $dataEntries, $params)
 
 generateTableInsertSQLList ($tableName, $tableDef, $dataEntries, $params, $withClosure=true)
 
 isMultiInsertSupported ()
 
 transformData (&$data, $toLocal)
 
 transformSchema (&$schema, $toLocal)
 

Detailed Description

Handles schemas for MySQL.

Member Function Documentation

eZMysqlSchema::escapeSQLString (   $value)
virtual

Implements eZDBSchemaInterface.

eZMysqlSchema::eZMysqlSchema (   $params)

Constructor

Parameters
dbinstance
eZMysqlSchema::fetchTableFields (   $table,
  $params 
)
private
Parameters
tablename

Referenced by schema().

eZMysqlSchema::fetchTableIndexes (   $table,
  $params 
)
private

Referenced by schema().

eZMysqlSchema::generateAddFieldSql (   $table_name,
  $field_name,
  $def,
  $params 
)
private
eZMysqlSchema::generateAddIndexSql (   $table_name,
  $index_name,
  $def,
  $params,
  $isEmbedded = false 
)
private

Referenced by generateTableSQL().

eZMysqlSchema::generateAlterFieldSql (   $table_name,
  $field_name,
  $def = array() 
)
privatevirtual

Implements eZDBSchemaInterface.

eZMysqlSchema::generateDropIndexSql (   $table_name,
  $index_name,
  $def,
  $params 
)
private
eZMysqlSchema::generateDropTable (   $table,
  $params 
)
private
eZMysqlSchema::generateFieldDef (   $field_name,
  $def,
$skip_primary,
  $params = null 
)
private
eZMysqlSchema::generateTableOption (   $tableName,
  $tableDef,
  $optionType,
  $optionValue,
  $params 
)

Detects known options and generates the MySQL SQL code for it.

Returns
The SQL code as a string or false if not known.
Parameters
$optionTypeThe type of option, the supported ones are:
  • delay_key_write - If $optionValue is true then adds DELAY_KEY_WRITE=1

Referenced by generateTableSQL().

eZMysqlSchema::generateTableSchema (   $tableName,
  $table,
  $params 
)
virtual
Note
Calls generateTableSQL() with $asArray set to false

Implements eZDBSchemaInterface.

eZMysqlSchema::generateTableSQL (   $tableName,
  $tableDef,
  $params,
  $asArray,
  $separateTypes = false 
)
private
Parameters
$asArrayIf true all SQLs are return in an array, if not they are returned as a string.
Note
When returned as array the SQLs will not have a semi-colon to end the statement

Referenced by generateTableSchema(), and generateTableSQLList().

eZMysqlSchema::generateTableSQLList (   $tableName,
  $table,
  $params,
  $separateTypes 
)
virtual
Note
Calls generateTableSQL() with $asArray set to true

Implements eZDBSchemaInterface.

eZMysqlSchema::isMultiInsertSupported ( )

MySQL 3.22.5 and higher support multi-insert queries so if the current database has sufficient version we return true. If no database is connected we return .

eZMysqlSchema::parseType (   $type_info,
$length_info 
)

Referenced by fetchTableFields().

eZMysqlSchema::schema (   $params = array())
virtual

Implements eZDBSchemaInterface.

eZMysqlSchema::schemaName ( )
virtual

Implements eZDBSchemaInterface.

eZMysqlSchema::schemaType ( )
virtual

Implements eZDBSchemaInterface.

eZMysqlSchema::tableCharsetName (   $charset)
Returns
The name of the charset $charset in a format MySQL understands.

Referenced by generateTableSQL().

eZMysqlSchema::tableStorageTypeName (   $type)
Returns
The name of storage type $type or false if not supported.
Note
Currently supports bdb, myisam and innodb.

See http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html for overview of the types MySQL supports

Referenced by generateTableSQL().


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