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

Static Public Member Functions

static parse (DomElement $schema)
 
static getSchemaUdts (DomElement $schema)
 
static getTableSequences (DomElement $table)
 
static getConstraintsFromParent (DomElement $parent)
 
static getTableConstraints (DomElement $table)
 
static getTableIndexes (DomElement $table)
 
static getTableColumns (DomElement $table)
 
static validate (DomElement $schema)
 
static validateTable (DomElement $table)
 
static validateTableColumns (DomElement $table)
 
static validSchemaColumnType (DomElement $table, $type)
 
static validateTableConstraints (DomElement $table)
 
static validateConstraints (DomElement $parent, $prefix='')
 
static validateTableIndexes (DomElement $table)
 
static validateTableSequences (DomElement $table)
 
static validateSchemaUdts (DomElement $schema)
 
static tableHasColumn (DomElement $table, $columnName)
 
- Static Public Member Functions inherited from DALQueryParser
static parse (DomElement $query)
 
static parseCallQuery (DomElement $call)
 
static validateField (DomElement $field, $allowAlias=FALSE)
 
static validateValuesTag (DomElement $valuesTag)
 
static validateFunctionTag (DomElement $function)
 
static validateHook (DomElement $hook)
 

Additional Inherited Members

- Static Protected Member Functions inherited from DALQueryParser
static parseLimitClause (DomElement $select)
 
static parseInClause (DomElement $inCond, $level=0)
 
static parseExistsClause (DomElement $existsCond, $level=0)
 
static parseChildFields (DomElement $parent)
 
static parseSingleField (DomElement $fieldXML)
 
static parseMathOperation (DomElement $parent, $op='MATH-OP')
 
static parseSqlFunction (DomElement $function)
 
static validateFieldsTag (DomElement $fields)
 
static validateValueTag (DomElement $value)
 
static getUnionTag (DomElement $parentNode)
 
static addHookIds (DomElement $xmlQuery)
 

Detailed Description

DALSchemaParser.

Parses anything that is related to schemas (create table, constraints, etc).

Since
4.0.0

Definition at line 23 of file DALSchemaParser.inc.

Member Function Documentation

static getConstraintsFromParent ( DomElement  $parent)
static

Returns constraints from parent node.

Parameters
DomElement$parentParent node.
Since
4.0.0
Returns
array

Definition at line 199 of file DALSchemaParser.inc.

static getSchemaUdts ( DomElement  $schema)
static

Converts XML schema UDTs to php array.

Parameters
DomElement$schemaSchema node of a schema.
Since
4.0.0
Returns
array

Definition at line 131 of file DALSchemaParser.inc.

static getTableColumns ( DomElement  $table)
static

Converts XML table columns to php array.

Parameters
DomElement$tableTable node of a schema.
Since
4.0.0
Returns
array
Exceptions
DALParserExceptionIf an invalid User-Defined Type is referenced.

Definition at line 415 of file DALSchemaParser.inc.

static getTableConstraints ( DomElement  $table)
static

Converts XML table constraints to php array.

Parameters
DomElement$tableTable node of a schema.
Since
4.0.0
Returns
array

Definition at line 229 of file DALSchemaParser.inc.

static getTableIndexes ( DomElement  $table)
static

Converts XML table indexes to php array.

Parameters
DomElement$tableTable node of a schema.
Since
4.0.0
Returns
array

Definition at line 356 of file DALSchemaParser.inc.

static getTableSequences ( DomElement  $table)
static

Converts XML table sequences to php array.

Parameters
DomElement$tableTable node of a schema.
Since
4.0.0
Returns
array

Definition at line 174 of file DALSchemaParser.inc.

static parse ( DomElement  $schema)
static

Converts XML schema to php array.

Parameters
DomElement$schemaSchema node of a schema.
Since
4.0.0
Returns
array

Definition at line 98 of file DALSchemaParser.inc.

static tableHasColumn ( DomElement  $table,
  $columnName 
)
static

Returns true if table has the specified column listed in its columns tag.

Parameters
DomElement$tableXml elements of the table.
string$columnNameSearch for this column name.
Since
4.0.0
Returns
boolean
Exceptions
DALParserExceptionIf the DomElement passed is not a valid table element.

Definition at line 1082 of file DALSchemaParser.inc.

static validate ( DomElement  $schema)
static

Validates the given schema.

Validation will make sure all required elements, attributes, etc are available and contain no errors. Throws ChannelException if any errors are found.

Parameters
DomElement$schemaXml elements for a single schema.
Since
4.0.0
Returns
void
Exceptions
DALParserExceptionIf the parsed element is not a schema.

Definition at line 485 of file DALSchemaParser.inc.

static validateConstraints ( DomElement  $parent,
  $prefix = '' 
)
static

Validates general constraint rules.

Parameters
DomElement$parentParent node of the constraints.
string$prefixException message prefix.
Since
4.0.0
Returns
void

Definition at line 751 of file DALSchemaParser.inc.

static validateSchemaUdts ( DomElement  $schema)
static

Checks if the given schema has valid UDTs.

Throws DALParserException if any errors found.

Parameters
DomElement$schemaXml elements of the schema.
Since
4.0.0
Returns
void
Exceptions
DALParserExceptionIf the UDTs are invalid.

Definition at line 1006 of file DALSchemaParser.inc.

static validateTable ( DomElement  $table)
static

Validates the given table.

Validation will make sure all required elements, attributes, etc are available and contain no errors. Throws ChannelException if any errors are found.

Parameters
DomElement$tableXml elements for a single table.
Since
4.0.0
Returns
void
Exceptions
DALParserExceptionIf the table doesn't contain a name.

Definition at line 518 of file DALSchemaParser.inc.

static validateTableColumns ( DomElement  $table)
static

Validates given table's columns.

Throws ChannelException on error.

Parameters
DomElement$tableXml node of the table.
Since
4.0.0
Returns
boolean
Exceptions
DALParserExceptionIf the Table columns are incorrectly defined.

Definition at line 551 of file DALSchemaParser.inc.

static validateTableConstraints ( DomElement  $table)
static

Checks if the given table has valid constraints.

I.e. table must have a primary-key. Throws DALParserException.

Parameters
DomElement$tableXml elements of the table.
Since
4.0.0
Returns
boolean
Exceptions
DALParserExceptionIf there is no constraints tag or if the constraints are invalid.

Definition at line 665 of file DALSchemaParser.inc.

static validateTableIndexes ( DomElement  $table)
static

Checks if the given table has valid indexes.

Throws DALParserException if any errors found.

Parameters
DomElement$tableXml elements of the table.
Since
4.0.0
Returns
void
Exceptions
DALParserExceptionIf an index doesn't have a name, doesn't have any columns, or references a column that doesn't exist.

Definition at line 923 of file DALSchemaParser.inc.

static validateTableSequences ( DomElement  $table)
static

Checks if the given table has valid sequences.

Throws DALParserException if any errors found.

Parameters
DomElement$tableXml elements of the table.
Since
4.0.0
Returns
void
Exceptions
DALParserExceptionIf a sequence has no sequence tags, or is missing a name attribute.

Definition at line 970 of file DALSchemaParser.inc.

static validSchemaColumnType ( DomElement  $table,
  $type 
)
static

Determines if the given type is a valid column type.

Checks UDTs, CDTs, and FUDTs. Throws DALParserException.

Parameters
DomElement$tableTable or schema that this column belongs to.
string$typeType of the column.
Since
4.0.0
Returns
boolean

Definition at line 624 of file DALSchemaParser.inc.


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