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

Public Member Functions

 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

 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

 $dataTypes
 
 $sqlConstructs
 
 $mathOps
 
 $query = array()
 
 $name = ''
 

Detailed Description

DALConverter.

This class will have base functions that converts parsed XQDs to their SQL representation. XQDs are parsed by DALBaker and converted to PHP arrays. If new databases have different SQL constructs then they should extend this class and override its functions & members.

Since
4.0.0

Definition at line 25 of file DALConverter.inc.

Member Function Documentation

addSpaces (   $level = 0,
  $spaces = 4 
)
protected

Returns string of spaces.

Parameters
integer$levelNumber of levels to indent.
integer$spacesNumber of spaces for each indent level.
Since
4.0.0
Returns
string

Definition at line 1197 of file DALConverter.inc.

addSqlFilters ( array  $sqlArray)
protected

Returns string with the SQL filters included.

Parameters
array$sqlArrayThe Query array.
Since
4.0.0
Returns
string

Definition at line 311 of file DALConverter.inc.

convertAlterQuery ( array  $sqlArray)
protected

Converts ALTER TABLE statement to its SQL form.

Parameters
array$sqlArraySingle ALTER TABLE query.
Since
4.0.0
Returns
string

Definition at line 1369 of file DALConverter.inc.

convertAlterQueryAddColumn ( array  $addColumn)
protected

Converts ALTER TABLE ADD COLUMN statement to its SQL form.

Throws DALConverterException if no columns found.

Parameters
array$addColumnADD COLUMN array.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIf columns not specified.

Definition at line 1397 of file DALConverter.inc.

convertAlterQueryAddConstraint ( array  $constraints,
  $tableName = NULL 
)
protected

Converts ALTER TABLE ADD CONSTRAINT statement to its SQL format.

Returns empty string if no constraints found.

Parameters
array$constraintsList of constraints.
string$tableNameName of the table to alter.
Since
4.0.0
Returns
string

Definition at line 1518 of file DALConverter.inc.

convertAlterQueryDropColumn (   $column)
protected

Converts ALTER TABLE DROP COLUMN statement to its SQL format.

Throws DALConverterException if no column name given.

Parameters
string$columnColumn name.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIf column name is not specified.

Definition at line 1431 of file DALConverter.inc.

convertAlterQueryDropConstraint (   $dropConstraint)
protected

Converts ALTER TABLE DROP CONSTRAINT to its SQL format.

Throws DALConverterException if no column name given.

Parameters
string$dropConstraintName of the constraint to drop.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIf constraint name is empty.

Definition at line 1546 of file DALConverter.inc.

convertAlterQueryHeader (   $tableName)
protected

Starts the ALTER query statement.

Parameters
string$tableNameName of the table to alter.
Since
4.0.0
Returns
string

Definition at line 1353 of file DALConverter.inc.

convertAlterQueryModifyColumn ( array  $modifyColumns)
protected

Converts ALTER TABLE MODIFY COLUMN statement to its SQL format.

Throws DALConverterException if no columns provided.

Parameters
array$modifyColumnsColumns to be modified.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIf columns not specified.

Definition at line 1484 of file DALConverter.inc.

convertAlterQueryRenameColumn ( array  $renameColumn)
protected

Converts ALTER TABLE RENAME COLUMN statement to its SQL format.

Throws DALConverterException if old column name or new column name is not provided.

Parameters
array$renameColumnOld and New column names.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIf old or new column name is not specified.

Definition at line 1458 of file DALConverter.inc.

convertAlterQueryRenameTable ( array  $renameTable)
protected

Converts ALTER TABLE RENAME TABLE statement to its SQL format.

Throws DALConverterException if old column name or new column name is not provided.

Parameters
array$renameTableOld and New table name.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIf old or new name is not specified.

Definition at line 1573 of file DALConverter.inc.

convertCallQuery ( array  $callQuery)
protected

Converts a 'CALL' query into SQL.

Parameters
array$callQueryThe array containing the function structure.
Since
4.0.0
Returns
string

Definition at line 2038 of file DALConverter.inc.

convertConstraints ( array  $constraintsList,
  $asArray = FALSE 
)
protected

Converts constraints list to their SQL format.

Each constraint type (PK, FK, UQ) has its own method to convert a single constraint. This function is used by CREATE TABLE and ALTER TABLE CONSTRAINTS.

Parameters
array$constraintsListThe constraints array.
boolean$asArrayIf true result will be array of strings.
Since
4.0.0
Returns
string

Definition at line 1743 of file DALConverter.inc.

convertCreateColumns ( array  $table)
protected

Converts array of create clause columns to their SQL format.

Parameters
array$tableThe table array.
Since
4.0.0
Returns
string

Definition at line 1671 of file DALConverter.inc.

convertCreateFooter ( array  $table)
protected

Returns the start of the create table statement.

Create stetement close bracket and semi-colon. Postgres: );.

Parameters
array$tableCREATE array.
Since
4.0.0
Returns
string

Definition at line 1655 of file DALConverter.inc.

convertCreateHeader ( array  $table)
protected

Returns the start of the create table statement.

Postgres: CREATE TABLE assets (.

Parameters
array$tableCREATE array.
Since
4.0.0
Returns
string

Definition at line 1636 of file DALConverter.inc.

convertCreateIndexes ( array  $table)
protected

Converts list of Index to SQL string.

Parameters
array$tableThe table array.
Since
4.0.0
Returns
string

Definition at line 1855 of file DALConverter.inc.

convertCreateSequences ( array  $sequences)
protected

Converts list of SEQUENCE stataments.

Parameters
array$sequencesCreate sequence stataments.
Since
4.0.0
Returns
string

Definition at line 1900 of file DALConverter.inc.

convertCreateTable ( array  $table)

Converts create statement to SQL string.

Parameters
array$tableCREATE array.
Since
4.0.0
Returns
string

Definition at line 1601 of file DALConverter.inc.

convertDeleteQuery ( array  $sqlArray)
protected

Converts delete query to its SQL string.

Parameters
array$sqlArrayDelete query array.
Since
4.0.0
Returns
string

Definition at line 1329 of file DALConverter.inc.

convertDropSequence (   $sequenceName)

Converts DROP TABLE statement.

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

Definition at line 1983 of file DALConverter.inc.

convertDropTable (   $tableName,
  $cascade = FALSE 
)

Converts DROP TABLE statement.

Parameters
string$tableNameName of the table to drop from the db.
boolean$cascadeIf TRUE, deletions will be cascaded to dependent objects.
Since
4.0.0
Returns
string

Definition at line 1947 of file DALConverter.inc.

convertExistsCondition ( array  $exists,
  $level = 0,
  $type = 'EXISTS' 
)
protected

Converts EXISTS condition to its SQL format.

Parameters
array$existsThe exists condition array.
integer$levelNumber of levels to indent.
string$typeThe type of exists condition (exists/not-exists).
Since
4.0.0
Returns
string

Definition at line 875 of file DALConverter.inc.

convertField ( array  $field)
protected

Converts single field to its SQL format.

Parameters
array$fieldField's name.
Since
4.0.0
Returns
string

Definition at line 501 of file DALConverter.inc.

convertFromList ( array  $from,
  $level = 1 
)
protected

Converts From clause to its SQL format.

Parameters
array$fromThe from clause array.
integer$levelNumber of levels to indent.
Since
4.0.0
Returns
string

Definition at line 599 of file DALConverter.inc.

convertGroupBy ( array  $groupBy)
protected

Converts GROUP BY clause.

Parameters
array$groupBySingle GROUP BY clause.
Since
4.0.0
Returns
string

Definition at line 1048 of file DALConverter.inc.

convertInCondition ( array  $in,
  $level = 0,
  $type = 'IN' 
)
protected

Converts IN condition to its SQL format.

Parameters
array$inThe in condition array.
integer$levelNumber of levels to indent.
string$typeType of in condition (in/not-in).
Since
4.0.0
Returns
string

Definition at line 839 of file DALConverter.inc.

convertInsertQuery ( array  $sqlArray)
protected

Converts Insert query to its SQL format.

Parameters
array$sqlArrayThe insert query.
Since
4.0.0
Returns
string

Definition at line 1177 of file DALConverter.inc.

convertInsertQueryFields ( array  $fields)
protected

Converts Insert query's fields to their SQL format.

Parameters
array$fieldsArray of fields.
Since
4.0.0
Returns
string

Definition at line 1212 of file DALConverter.inc.

convertInsertQueryValues ( array  $insert)
protected

Converts Insert query's values to their SQL format.

Converting values require the fields array. Because, fields list and values list must be in the same order.

Parameters
array$insertArray of the insert query.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIf field is missing.

Definition at line 1236 of file DALConverter.inc.

convertIsNull ( array  $isNull)
protected

Converts IS NULL statament.

Parameters
array$isNullIS NULL array.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionIs-null value is empty.

Definition at line 896 of file DALConverter.inc.

convertJoins ( array  $joins)
protected

Converts array of joins to their SQL form.

Parameters
array$joinsArray of joins.
Since
4.0.0
Returns
string

Definition at line 1126 of file DALConverter.inc.

convertLikeCondition ( array  $condition)
protected

Handles LIKE conditions.

Parameters
array$conditionThe condition information.
Since
4.0.0
Returns
string

Definition at line 2112 of file DALConverter.inc.

convertLimit ( array  $limit)
protected

Converts LIMIT.

Parameters
array$limitSingle LIMIT clause.
Since
4.0.0
Returns
string

Definition at line 1108 of file DALConverter.inc.

convertMathOperation ( array  $mathOp)
protected

Converts a math operation block to its SQL format.

This function will call it self when there are multiple operations. For example: ((x + y) - z). Math ops can contain fields, values, function calls and hooks.

Parameters
array$mathOpThe math op block.
Since
4.0.0
Returns
string

Definition at line 677 of file DALConverter.inc.

convertNotNull ( array  $notNull)
protected

Converts NOT NULL statament.

Parameters
array$notNullIS NULL array.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionNot null value is empty.

Definition at line 926 of file DALConverter.inc.

convertOrderBy ( array  $orderBy)
protected

Converts ORDER BY clause.

Parameters
array$orderBySingle ORDER BY clause.
Since
4.0.0
Returns
string

Definition at line 1075 of file DALConverter.inc.

convertResetSequence (   $sequenceName)

Converts DROP TABLE statement.

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

Definition at line 1999 of file DALConverter.inc.

convertSelectFieldList ( array  $fields,
  $level = 1 
)
protected

Converts Select's field list to its SQL format.

Parameters
array$fieldsArray of fields.
integer$levelNumber of levels to indent.
Since
4.0.0
Returns
string

Definition at line 350 of file DALConverter.inc.

convertSelectQuery ( array  $sqlArray,
  $level = 0,
array  $ignore = array() 
)
protected

Converts Select query to its SQL string.

Parameters
array$sqlArrayThe select query array.
integer$levelNumber of levels to indent.
array$ignoreTag names that will be ignored while converting the select statement. Example: where,join..
Since
4.0.0
Returns
string

Definition at line 251 of file DALConverter.inc.

convertSingleCreateColumn ( array  $col)
protected

Converts single create column to its SQL string.

Single create column consists of column's name, type (size and scale), null/not null, and its default value.

For Postgres SQL will look like: assetid VARCHAR2(15) NOT NULL DEFAUL 1.

Parameters
array$colSingle column in create clause.
Since
4.0.0
Returns
string

Definition at line 1698 of file DALConverter.inc.

convertSingleField (   $field)
protected

Converts single field to its SQL format.

Field maybe a column, value, hook, function, math operation.

Parameters
(string|array)$field The field array or string.
Since
4.0.0
Returns
string

Definition at line 374 of file DALConverter.inc.

convertSingleForeignKey ( array  $fk)
protected

Converts single foreign key constraint to its SQL string.

Postgres: CONSTRAINT links_table_fk FOREIGN KEY (assetid) REFERENCES assets_table (assetid) ON DELETE CASCADE.

Parameters
array$fkSingle foreign key constraint.
Since
4.0.0
Returns
string

Definition at line 1806 of file DALConverter.inc.

convertSingleFunction ( array  $function)
protected

Converts a single function to its SQL string.

Parameters
array$functionFunction array.
Since
4.0.0
Returns
string

Definition at line 563 of file DALConverter.inc.

convertSingleIndex ( array  $idx,
  $tableName 
)
protected

Converts single Index to its SQL string.

Postgres: INDEX index_name (assetid, linkid).

Parameters
array$idxSingle index array.
string$tableNameName of the table.
Since
4.0.0
Returns
string

Definition at line 1883 of file DALConverter.inc.

convertSingleJoin ( array  $join)
protected

Converts a single join.

Parameters
array$joinSingle join array.
Since
4.0.0
Returns
string

Definition at line 1149 of file DALConverter.inc.

convertSinglePrimaryKey ( array  $pk)
protected

Converts single primary key constraint to its SQL string.

Postgres: CONSTRAINT assets_table_pk PRIMARY KEY (assetid).

Parameters
array$pkSingle primary key constraint.
Since
4.0.0
Returns
string

Definition at line 1786 of file DALConverter.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 1927 of file DALConverter.inc.

convertSingleUnique ( array  $un)
protected

Converts single unique constraint to its SQL string.

Postgres: CONSTRAINT unique_uk UNIQUE (someid).

Parameters
array$unSingle unique constraint.
Since
4.0.0
Returns
string

Definition at line 1838 of file DALConverter.inc.

convertSingleValue (   $field)
protected

Converts a single value to its SQL format.

Parameters
array | string$fieldThe field value.
Since
4.0.0
Returns
string

Definition at line 531 of file DALConverter.inc.

convertTableAlias (   $alias)
protected

Converts given alias string to table alias.

Parameters
string$aliasAlias of the table.
Since
4.0.0
Returns
array

Definition at line 658 of file DALConverter.inc.

convertToSql ( array  $sqlArray)

Converts given query to its SQL.

Parameters
array$sqlArraySingle query.
Since
4.0.0
Returns
string

Definition at line 198 of file DALConverter.inc.

convertTruncateTable (   $tableName)

Converts TRUNCATE TABLE statement.

Parameters
string$tableNameName of the table to truncate.
Since
4.0.0
Returns
string

Definition at line 1967 of file DALConverter.inc.

convertUnionDisplayName (   $type)
protected

Convert the display name of union and union-all.

If the DB needs to display, in the SQL, something other than UNION or UNION-ALL (eg. DB2 needs UNION ALL), then return it here.

Parameters
string$typeThe type of the union (UNION or UNION-ALL).
Since
4.0.0
Returns
string

Definition at line 1033 of file DALConverter.inc.

convertUnions ( array  $union,
  $level = 1 
)
protected

Convert list of union and union-all.

Parameters
array$unionArray of selects in union/union-all.
integer$levelNumber of levels to indent.
Since
4.0.0
Returns
string

Definition at line 998 of file DALConverter.inc.

convertUnionsInFromClause ( array  $union,
  $level = 0 
)
protected

Convert list of union that are in side a FROM clause.

Parameters
array$unionArray of selects in union/union-all.
integer$levelNumber of levels to indent.
Since
4.0.0
Returns
string

Definition at line 956 of file DALConverter.inc.

convertUpdateQuery ( array  $sqlArray)
protected

Converts update query to its SQL string.

Parameters
array$sqlArrayDelete query array.
Since
4.0.0
Returns
string

Definition at line 1277 of file DALConverter.inc.

convertUpdateQuerySetValues ( array  $values)
protected

Converts update query's set values to its SQL format.

Parameters
array$valuesArray of values to set.
Since
4.0.0
Returns
string

Definition at line 1300 of file DALConverter.inc.

convertWhereClause ( array  $where,
  $level = 0,
  $addBrackets = TRUE 
)
protected

Converts Where clause to its SQL format.

Parameters
array$whereThe where clasue array.
integer$levelNumber of levels to indent.
boolean$addBracketsAdd brackets around first where condition.
Since
4.0.0
Returns
string
Exceptions
DALConverterExceptionFails to convert where clause.

Definition at line 764 of file DALConverter.inc.

convertWithQuery ( array  $withQuery)
protected

Converts a WITH query.

Parameters
array$withQueryArray containing the with query information.
Since
4.0.0
Returns
string

Definition at line 2016 of file DALConverter.inc.

getComparisonOperators (   $type = NULL)
protected

Returns list of allowed where clause conditions.

Parameters
string$typeType of the condition. It will return its sign.
Since
4.0.0
Returns
array

Definition at line 2305 of file DALConverter.inc.

getConstructName (   $name)

Returns the construct string for the current database type.

Classes that extend this class should override the sqlConstructs member.

Parameters
string$nameBase name of the construct to get.
Since
4.0.0
Returns
string

Definition at line 178 of file DALConverter.inc.

getDataType (   $type)

Returns the database specific data type.

Sub classes should override the $dataTypes member.

Parameters
string$typeBase data type.
Since
4.0.0
Returns
string

Definition at line 143 of file DALConverter.inc.

getName ( )

Returns the readable database name.

Since
4.0.0
Returns
string

Definition at line 161 of file DALConverter.inc.

getSelectFieldName ( array  $field)
protected

Given a field it returns its name.

Parameters
array$fieldSingle field from select field list.
Since
4.0.0
Returns
array

Definition at line 409 of file DALConverter.inc.

getSelectFieldNames ( array  $fields)
protected

Given list of fields it returns their name.

Parameters
array$fieldsFields from Select field list.
Since
4.0.0
Returns
array

Definition at line 481 of file DALConverter.inc.

getUnionType ( array  $union)
protected

Returns the type of the union.

Parameters
array$unionArray of a union/union-all.
Since
4.0.0
Returns
string

Definition at line 975 of file DALConverter.inc.

handleFunctionArray ( array  $args)
protected

Handles ARRAY cast function.

Parameters
array$argsString to cast to array.
Since
4.0.0
Returns
string

Definition at line 2096 of file DALConverter.inc.

handleFunctionBindcast ( array  $args)
protected

Handles the BINDCAST() function call.

BINDCAST is used to wrap bind vars. Default will only print the bind var

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2149 of file DALConverter.inc.

handleFunctionCast ( array  $args)
protected

Handles the CAST() function call.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2131 of file DALConverter.inc.

handleFunctionCoalesce ( array  $args)
protected

Handles the COALESCE() function.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2181 of file DALConverter.inc.

handleFunctionConcat ( array  $args)
protected

Handles the CONCAT() function call.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2080 of file DALConverter.inc.

handleFunctionCount ( array  $args)
protected

Handles the COUNT() function.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2252 of file DALConverter.inc.

handleFunctionLength ( array  $args)
protected

Handles the LENGTH() function.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2165 of file DALConverter.inc.

handleFunctionMax ( array  $args)
protected

Handles the MAX() function.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2204 of file DALConverter.inc.

handleFunctionMin ( array  $args)
protected

Handles the MIN() function.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2228 of file DALConverter.inc.

handleFunctionSubstring ( array  $args)
protected

Handles the SUBSTRING() function.

see DB2, MSSQL and Oracle converter for different syntax

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 2279 of file DALConverter.inc.

handleFunctionTableExists (   $tableName,
  $schema = NULL 
)

Handles table exists.

Parameters
(array|string)$tableName Table name argument.
string$schemaThe schema to check the table for.
Since
4.0.0
Returns
string

Definition at line 2056 of file DALConverter.inc.

separateFields ( array  $fields)
protected

Separates arary of fields/values and returns its SQL string.

Parameters
array$fieldsArray of fields to separate.
Since
4.0.0
Returns
string

Definition at line 731 of file DALConverter.inc.

separateTables ( array  $tables)
protected

Separates arary of tables and returns its SQL string.

Parameters
array$tablesArray of fields to separate.
Since
4.0.0
Returns
string

Definition at line 746 of file DALConverter.inc.

setSelectFieldAlias ( array  $field,
  $alias 
)
protected

Given a field it will update its alias.

Parameters
array$fieldA field from Select field list.
string$aliasNew alias for the field.
Since
4.0.0
Returns
array

Definition at line 452 of file DALConverter.inc.

Field Documentation

$dataTypes
protected
Initial value:
= array(
'char' => 'CHAR',
'varchar' => 'VARCHAR',
'clob' => 'TEXT',
'blob' => 'BYTEA',
'integer' => 'INT',
'smallint' => 'SMALLINT',
'numeric' => 'NUMERIC',
'float' => 'FLOAT',
'real' => 'REAL',
'double_precision' => 'DOUBLE PRECISION',
'boolean' => 'BOOLEAN',
'date' => 'DATE',
'time' => 'TIME',
'timestamp' => 'TIMESTAMP',
'interval' => 'INTERVAL',
)

Definition at line 36 of file DALConverter.inc.

$mathOps
protected
Initial value:
= array(
'SUBTRACT' => '-',
'ADD' => '+',
'MULTIPLY' => '*',
'DIVIDE' => '/',
)

Definition at line 87 of file DALConverter.inc.

$sqlConstructs
protected
Initial value:
= array(
'select' => 'SELECT',
'from' => 'FROM',
'where' => 'WHERE',
'in' => 'IN',
'not-in' => 'NOT IN',
'limit' => 'LIMIT',
'group-by' => 'GROUP BY',
'having' => 'HAVING',
'order-by' => 'ORDER BY',
'exists' => 'EXISTS',
'not-exists' => 'NOT EXISTS',
'start-with' => 'START WITH',
'connect-by' => 'CONNECT BY PRIOR',
)

Definition at line 62 of file DALConverter.inc.


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