Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
DALMysqlConverter Class Reference
Inheritance diagram for DALMysqlConverter:
DALConverter

Public Member Functions

 __construct ()
 
 convertCreateTable (array $table)
 
 convertDropSequence ($sequenceName)
 
 convertDropTable ($tableName)
 
 handleFunctionSequenceExists ($sequenceName)
 
- Public Member Functions inherited from DALConverter
 getDataType ($type)
 
 getName ()
 
 getConstructName ($name)
 
 convertToSql (array $sqlArray)
 
 convertCreateTable (array $table)
 
 convertDropTable ($tableName, $cascade=FALSE)
 
 convertTruncateTable ($tableName)
 
 convertDropSequence ($sequenceName)
 
 convertResetSequence ($sequenceName)
 
 handleFunctionTableExists ($tableName, $schema=NULL)
 

Protected Member Functions

 convertAlterQueryAddConstraint (array $constraints, $incHeader=FALSE)
 
 convertSingleSequence ($sequence)
 
 handleFunctionSeqNextVal (array $seqName)
 
 handleFunctionSeqCurrVal (array $seqName)
 
 handleFunctionToDate (array $args)
 
 handleFunctionConcat (array $args)
 
 convertCallQuery (array $callQuery)
 
- Protected Member Functions inherited from DALConverter
 convertSelectQuery (array $sqlArray, $level=0, array $ignore=array())
 
 addSqlFilters (array $sqlArray)
 
 convertSelectFieldList (array $fields, $level=1)
 
 convertSingleField ($field)
 
 getSelectFieldName (array $field)
 
 setSelectFieldAlias (array $field, $alias)
 
 getSelectFieldNames (array $fields)
 
 convertField (array $field)
 
 convertSingleValue ($field)
 
 convertSingleFunction (array $function)
 
 convertFromList (array $from, $level=1)
 
 convertTableAlias ($alias)
 
 convertMathOperation (array $mathOp)
 
 separateFields (array $fields)
 
 separateTables (array $tables)
 
 convertWhereClause (array $where, $level=0, $addBrackets=TRUE)
 
 convertInCondition (array $in, $level=0, $type='IN')
 
 convertExistsCondition (array $exists, $level=0, $type='EXISTS')
 
 convertIsNull (array $isNull)
 
 convertNotNull (array $notNull)
 
 convertUnionsInFromClause (array $union, $level=0)
 
 getUnionType (array $union)
 
 convertUnions (array $union, $level=1)
 
 convertUnionDisplayName ($type)
 
 convertGroupBy (array $groupBy)
 
 convertOrderBy (array $orderBy)
 
 convertLimit (array $limit)
 
 convertJoins (array $joins)
 
 convertSingleJoin (array $join)
 
 convertInsertQuery (array $sqlArray)
 
 addSpaces ($level=0, $spaces=4)
 
 convertInsertQueryFields (array $fields)
 
 convertInsertQueryValues (array $insert)
 
 convertUpdateQuery (array $sqlArray)
 
 convertUpdateQuerySetValues (array $values)
 
 convertDeleteQuery (array $sqlArray)
 
 convertAlterQueryHeader ($tableName)
 
 convertAlterQuery (array $sqlArray)
 
 convertAlterQueryAddColumn (array $addColumn)
 
 convertAlterQueryDropColumn ($column)
 
 convertAlterQueryRenameColumn (array $renameColumn)
 
 convertAlterQueryModifyColumn (array $modifyColumns)
 
 convertAlterQueryAddConstraint (array $constraints, $tableName=NULL)
 
 convertAlterQueryDropConstraint ($dropConstraint)
 
 convertAlterQueryRenameTable (array $renameTable)
 
 convertCreateHeader (array $table)
 
 convertCreateFooter (array $table)
 
 convertCreateColumns (array $table)
 
 convertSingleCreateColumn (array $col)
 
 convertConstraints (array $constraintsList, $asArray=FALSE)
 
 convertSinglePrimaryKey (array $pk)
 
 convertSingleForeignKey (array $fk)
 
 convertSingleUnique (array $un)
 
 convertCreateIndexes (array $table)
 
 convertSingleIndex (array $idx, $tableName)
 
 convertCreateSequences (array $sequences)
 
 convertSingleSequence ($sequence)
 
 convertWithQuery (array $withQuery)
 
 convertCallQuery (array $callQuery)
 
 handleFunctionConcat (array $args)
 
 handleFunctionArray (array $args)
 
 convertLikeCondition (array $condition)
 
 handleFunctionCast (array $args)
 
 handleFunctionBindcast (array $args)
 
 handleFunctionLength (array $args)
 
 handleFunctionCoalesce (array $args)
 
 handleFunctionMax (array $args)
 
 handleFunctionMin (array $args)
 
 handleFunctionCount (array $args)
 
 handleFunctionSubstring (array $args)
 
 getComparisonOperators ($type=NULL)
 

Protected Attributes

 $tableName = ''
 
 $name = 'MySQL'
 
 $dataTypes
 
- Protected Attributes inherited from DALConverter
 $dataTypes
 
 $sqlConstructs
 
 $mathOps
 
 $query = array()
 
 $name = ''
 

Detailed Description

DALMysqlConverter.

Contains methods to perform any database specific conversions into SQL. The methods to convert XML structures into SQL are defined in the parent class "DALConverter", and if any conversions need to be altered for this database the corresponding methods of DALConverter should be redefined here.

Since
4.0.0

Definition at line 25 of file DALMysqlConverter.inc.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Since
4.0.0

Definition at line 74 of file DALMysqlConverter.inc.

Member Function Documentation

convertAlterQueryAddConstraint ( array  $constraints,
  $incHeader = FALSE 
)
protected

Converts ALTER TABLE ADD CONSTRAINT statement to its SQL format.

Returns empty string if no constraints found.

Parameters
array$constraintsList of constraints.
boolean$incHeaderIf true ALTER query header will be added.
Since
4.0.0
Returns
string

Definition at line 126 of file DALMysqlConverter.inc.

convertCallQuery ( array  $callQuery)
protected

Converts a single CALL query.

Parameters
array$callQueryThe structure of the call query to convert.
Since
4.0.0
Returns
string

Definition at line 302 of file DALMysqlConverter.inc.

convertCreateTable ( array  $table)

Converts create statement to SQL string.

Parameters
array$tableCREATE array.
Since
4.0.0
Returns
string

Definition at line 88 of file DALMysqlConverter.inc.

convertDropSequence (   $sequenceName)

Converts DROP SEQUENCE statement.

MySQL does not support sequences, tables created instead of sequences.

Parameters
string$sequenceNameName of the sequence to drop from the db.
Since
4.0.0
Returns
string

Definition at line 216 of file DALMysqlConverter.inc.

convertDropTable (   $tableName)

Converts DROP TABLE statement.

Parameters
string$tableNameName of the table to drop from the db.
Since
4.0.0
Returns
string

Definition at line 255 of file DALMysqlConverter.inc.

convertSingleSequence (   $sequence)
protected

Converts a single CREATE SEQUENCE statament.

Parameters
string$sequenceName of the sequence.
Since
4.0.0
Returns
string

Definition at line 159 of file DALMysqlConverter.inc.

handleFunctionConcat ( array  $args)
protected

Handles the CONCAT() function call.

Parameters
array$argsThe arguments to the concat function.
Since
4.0.0
Returns
string

Definition at line 286 of file DALMysqlConverter.inc.

handleFunctionSeqCurrVal ( array  $seqName)
protected

Handles the seqNextVal() function call.

This function should be used to get the current value of a sequence. Note: SeqNextVal must be called before this function.

Parameters
array$seqNameName of the sequence.
Since
4.0.0
Returns
string

Definition at line 198 of file DALMysqlConverter.inc.

handleFunctionSeqNextVal ( array  $seqName)
protected

Handles the SeqNextVal() function call.

This function should be used to get the next value of a sequence.

Parameters
array$seqNameName of the sequence.
Since
4.0.0
Returns
string

Definition at line 179 of file DALMysqlConverter.inc.

handleFunctionSequenceExists (   $sequenceName)

Handles sequence exists.

Parameters
(array|string)$sequenceName Sequence name.
Since
4.0.0
Returns
string

Definition at line 271 of file DALMysqlConverter.inc.

handleFunctionToDate ( array  $args)
protected

Handles a custom DAL ToDate() function call.

This function will convert an ISO8601 date into a format suitable for insertion into a query.

Parameters
array$argsThe arguments of the function.
Since
4.0.0
Returns
string

Definition at line 235 of file DALMysqlConverter.inc.

Field Documentation

$dataTypes
protected
Initial value:
= array(
'char' => 'CHAR',
'varchar' => 'VARCHAR',
'clob' => 'LONGTEXT',
'blob' => 'LONGBLOB',
'integer' => 'INT',
'smallint' => 'SMALLINT',
'numeric' => 'NUMERIC',
'float' => 'FLOAT',
'real' => 'REAL',
'double_precision' => 'DOUBLE PRECISION',
'boolean' => 'VARCHAR(10)',
'date' => 'DATE',
'time' => 'TIME',
'timestamp' => 'DATETIME',
'time with time zone' => 'TIME',
)

Definition at line 50 of file DALMysqlConverter.inc.

string $tableName = ''
protected

Name of the table that is being converted.

Since
4.0.0

Definition at line 34 of file DALMysqlConverter.inc.


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