Class Xyster_Db_Gateway_Pdo_Mysql

Description

A gateway and abstraction layer for MySQL

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • license: New BSD License

Located in /Db/Gateway/Pdo/Mysql.php (line 28)

Xyster_Db_Gateway_Abstract
   |
   --Xyster_Db_Gateway_Pdo_Mysql
Direct descendents
Class Description
Xyster_Db_Gateway_Mysqli A gateway and abstraction layer for MySQLi connections
Method Summary
Xyster_Db_Gateway_Pdo_Mysql __construct ([ $db = null])
void listForeignKeys ()
array listIndexes ()
void renameIndex (string $old, string $new, [string $table = null])
void setAdapter ( $db)
string _getDropForeignSql (string $table, string $name)
string _getDropIndexSql (string $name, [string $table = null])
string _getDropPrimarySql (string $table, [string $name = null])
string _getRenameColumnSql (string $table, string $old, string $new)
string _getRenameIndexSql (string $old, string $new, [string $table = null])
string _getRenameTableSql (string $old, string $new)
string _getSetNullSql (string $table, string $column, [boolean $null = true])
string _getSetTypeSql (string $table, string $column,  $type, [mixed $argument = null])
string _translateType ( $type, [mixed $argument = null])
Methods
Constructor __construct (line 35)

Creates a new MySQL DB gateway

  • access: public
Xyster_Db_Gateway_Pdo_Mysql __construct ([ $db = null])
  • Zend_Db_Adapter_Pdo_Mysql $db: The database adapter to use

Redefinition of:
Xyster_Db_Gateway_Abstract::__construct()
Creates a new DB gateway

Redefined in descendants as:
listForeignKeys (line 68)

Lists all foreign keys

The return value is an associative array keyed by the key name, as returned by the RDBMS.

The value of each array element is an associative array with the following keys:

KEY_NAME => string; foreign key name SCHEMA_NAME => string; name of database or schema TABLE_NAME => string; name of table COLUMNS => array; An array of the column names REFERENCED_TABLE_NAME => string; name of referenced table REFERENCED_COLUMNS => array; An array of the referenced column names ON_UPDATE => string; ON_DELETE => string;

  • access: public
void listForeignKeys ()

Redefinition of:
Xyster_Db_Gateway_Abstract::listForeignKeys()
Lists all foreign keys
listIndexes (line 131)

Lists all indexes

The return value is an associative array keyed by the index name, as returned by the RDBMS.

The value of each array element is an associative array with the following keys:

INDEX_NAME => string; index name SCHEMA_NAME => string; name of database or schema TABLE_NAME => string; COLUMNS => array; An array of the column names PRIMARY => boolean; true if the index is a primary key UNIQUE => boolean; true if the index is a unique key

  • access: public
array listIndexes ()

Redefinition of:
Xyster_Db_Gateway_Abstract::listIndexes()
Lists all indexes
renameIndex (line 166)

Renames an index

  • access: public
void renameIndex (string $old, string $new, [string $table = null])
  • string $old: The current index name
  • string $new: The new index name
  • string $table: The table name (not required on all databases)

Redefinition of:
Xyster_Db_Gateway_Abstract::renameIndex()
Renames an index
setAdapter (line 45)

Sets the database adapter

  • access: public
void setAdapter ( $db)
  • Zend_Db_Adapter_Pdo_Mysql $db: The database adapter to use

Redefined in descendants as:
_getCreateIndexSql (line 186)

Gets the SQL statement to create an index

  • access: protected
string _getCreateIndexSql (Xyster_Db_Gateway_IndexBuilder $builder)

Redefinition of:
Xyster_Db_Gateway_Abstract::_getCreateIndexSql()
Gets the SQL statement to create an index
_getCreateTableSql (line 214)

Gets the SQL to create a table

This method does not process index/fulltext; indexes are not part of the SQL standard.

  • access: protected
string _getCreateTableSql (Xyster_Db_Gateway_TableBuilder $builder)

Redefinition of:
Xyster_Db_Gateway_Abstract::_getCreateTableSql()
Gets the SQL to create a table
_getDropForeignSql (line 232)

Gets the SQL statement to drop a foreign key from a table

MySQL Syntax for removal of a foreign key is different from SQL-92

  • access: protected
string _getDropForeignSql (string $table, string $name)
  • string $table: The table name
  • string $name: The key name

Redefinition of:
Xyster_Db_Gateway_Abstract::_getDropForeignSql()
Gets the SQL statement to drop a foreign key from a table
_getDropIndexSql (line 245)

Gets the SQL statement to drop an index

  • access: protected
string _getDropIndexSql (string $name, [string $table = null])
  • string $name: The index name
  • string $table: The table (not all dbs require this)

Redefinition of:
Xyster_Db_Gateway_Abstract::_getDropIndexSql()
Gets the SQL statement to drop an index
_getDropPrimarySql (line 258)

Gets the SQL statement to drop a primary key from a table

  • access: protected
string _getDropPrimarySql (string $table, [string $name = null])
  • string $table: The table name
  • string $name: The index name (not all dbs require this)

Redefinition of:
Xyster_Db_Gateway_Abstract::_getDropPrimarySql()
Gets the SQL statement to drop a primary key from a table
_getListSequencesSql (line 272)

Gets the SQL statement to list the sequences

If the DBMS doesn't support sequences, this method won't be called. There is no need to throw an exception for this method, just leave an empty method body or return null.

  • access: protected
string _getListSequencesSql ()

Redefinition of:
Xyster_Db_Gateway_Abstract::_getListSequencesSql()
Gets the SQL statement to list the sequences
_getRenameColumnSql (line 312)

Gets the SQL statement to rename a column in a table

  • access: protected
string _getRenameColumnSql (string $table, string $old, string $new)
  • string $table: The table name
  • string $old: The current column name
  • string $new: The new column name

Redefinition of:
Xyster_Db_Gateway_Abstract::_getRenameColumnSql()
Gets the SQL statement to rename a column in a table
_getRenameIndexSql (line 287)

Gets the SQL statement to rename an index

This method is left empty because in this class we overwrite the renameIndex method in the abstract gateway, which calls this one.

  • access: protected
string _getRenameIndexSql (string $old, string $new, [string $table = null])
  • string $old: The current index name
  • string $new: The new index name
  • string $table: The table name (not all dbs require this)

Redefinition of:
Xyster_Db_Gateway_Abstract::_getRenameIndexSql()
Gets the SQL statement to rename an index
_getRenameTableSql (line 298)

Gets the SQL statement to rename a table

  • access: protected
string _getRenameTableSql (string $old, string $new)
  • string $old: The current table name
  • string $new: The new table name

Redefinition of:
Xyster_Db_Gateway_Abstract::_getRenameTableSql()
Gets the SQL statement to rename a table
_getSetNullSql (line 337)

Gets the SQL statement to set a column's NULL status

  • access: protected
string _getSetNullSql (string $table, string $column, [boolean $null = true])
  • string $table: The table name
  • string $column: The column name
  • boolean $null: True for NULL, false for NOT NULL

Redefinition of:
Xyster_Db_Gateway_Abstract::_getSetNullSql()
Gets the SQL statement to set a column's NULL status
_getSetTypeSql (line 363)

Gets the SQL statement to set the data type of a column

  • access: protected
string _getSetTypeSql (string $table, string $column,  $type, [mixed $argument = null])
  • string $table: The table name
  • string $column: The column name
  • Xyster_Db_DataType $type: The data type
  • mixed $argument: An argument for the data type

Redefinition of:
Xyster_Db_Gateway_Abstract::_getSetTypeSql()
Gets the SQL statement to set the data type of a column
_translateType (line 383)

Translates a DataType enum into the correct SQL syntax

  • access: protected
string _translateType ( $type, [mixed $argument = null])
  • Xyster_Db_DataType $type
  • mixed $argument

Redefinition of:
Xyster_Db_Gateway_Abstract::_translateType()
Translates a DataType enum into the correct SQL syntax

Inherited Methods

Inherited From Xyster_Db_Gateway_Abstract

Xyster_Db_Gateway_Abstract::__construct()
Xyster_Db_Gateway_Abstract::addColumn()
Xyster_Db_Gateway_Abstract::addForeign()
Xyster_Db_Gateway_Abstract::addPrimary()
Xyster_Db_Gateway_Abstract::createIndex()
Xyster_Db_Gateway_Abstract::createSequence()
Xyster_Db_Gateway_Abstract::createTable()
Xyster_Db_Gateway_Abstract::dropColumn()
Xyster_Db_Gateway_Abstract::dropForeign()
Xyster_Db_Gateway_Abstract::dropIndex()
Xyster_Db_Gateway_Abstract::dropPrimary()
Xyster_Db_Gateway_Abstract::dropSequence()
Xyster_Db_Gateway_Abstract::dropTable()
Xyster_Db_Gateway_Abstract::executeIndexBuilder()
Xyster_Db_Gateway_Abstract::executeTableBuilder()
Xyster_Db_Gateway_Abstract::getAdapter()
Xyster_Db_Gateway_Abstract::listForeignKeys()
Xyster_Db_Gateway_Abstract::listIndexes()
Xyster_Db_Gateway_Abstract::listSequences()
Xyster_Db_Gateway_Abstract::renameColumn()
Xyster_Db_Gateway_Abstract::renameIndex()
Xyster_Db_Gateway_Abstract::renameSequence()
Xyster_Db_Gateway_Abstract::renameTable()
Xyster_Db_Gateway_Abstract::setDefault()
Xyster_Db_Gateway_Abstract::setNull()
Xyster_Db_Gateway_Abstract::setType()
Xyster_Db_Gateway_Abstract::setUnique()
Xyster_Db_Gateway_Abstract::supportsForeignKeys()
Xyster_Db_Gateway_Abstract::supportsSequences()
Xyster_Db_Gateway_Abstract::_getAddColumnSql()
Xyster_Db_Gateway_Abstract::_getAddForeignSql()
Xyster_Db_Gateway_Abstract::_getAddPrimarySql()
Xyster_Db_Gateway_Abstract::_getCreateIndexSql()
Xyster_Db_Gateway_Abstract::_getCreateSequenceSql()
Xyster_Db_Gateway_Abstract::_getCreateTableSql()
Xyster_Db_Gateway_Abstract::_getDropColumnSql()
Xyster_Db_Gateway_Abstract::_getDropForeignSql()
Xyster_Db_Gateway_Abstract::_getDropIndexSql()
Xyster_Db_Gateway_Abstract::_getDropPrimarySql()
Xyster_Db_Gateway_Abstract::_getDropSequenceSql()
Xyster_Db_Gateway_Abstract::_getDropTableSql()
Xyster_Db_Gateway_Abstract::_getListSequencesSql()
Xyster_Db_Gateway_Abstract::_getRenameColumnSql()
Xyster_Db_Gateway_Abstract::_getRenameIndexSql()
Xyster_Db_Gateway_Abstract::_getRenameSequenceSql()
Xyster_Db_Gateway_Abstract::_getRenameTableSql()
Xyster_Db_Gateway_Abstract::_getSetDefaultSql()
Xyster_Db_Gateway_Abstract::_getSetNullSql()
Xyster_Db_Gateway_Abstract::_getSetTypeSql()
Xyster_Db_Gateway_Abstract::_getSetUniqueSql()
Xyster_Db_Gateway_Abstract::_makeArray()
Xyster_Db_Gateway_Abstract::_quote()
Xyster_Db_Gateway_Abstract::_setAdapter()
Xyster_Db_Gateway_Abstract::_translateType()

Documentation generated on Mon, 19 May 2008 17:08:26 -0400 by phpDocumentor 1.4.2