DALQueryParser.
Base query parser. Contains common parsing functions like field parser etc.
- Since
- 4.0.0
Definition at line 38 of file DALQueryParser.inc.
static addHookIds |
( |
DomElement |
$xmlQuery | ) |
|
|
staticprotected |
Gets all the hooks in this query.
- Parameters
-
DomElement | $xmlQuery | DomElement that represents a single query. |
- Since
- 4.0.0
- Returns
- array
Definition at line 675 of file DALQueryParser.inc.
static getUnionTag |
( |
DomElement |
$parentNode | ) |
|
|
staticprotected |
Returns the union or union-all tag if there is one else returns NULL.
- Parameters
-
DomElement | $parentNode | Parent node. |
- Since
- 4.0.0
- Returns
- object
Definition at line 655 of file DALQueryParser.inc.
static parse |
( |
DomElement |
$query | ) |
|
|
static |
Constructs an SQL query from DomElement.
This is the main function where the SQL array is constructed from XML. It will combine queries from different parts of the system.
- Parameters
-
DomElement | $query | DomElement that represents a single query. |
- Since
- 4.0.0
- Returns
- array
- Exceptions
-
Definition at line 69 of file DALQueryParser.inc.
static parseCallQuery |
( |
DomElement |
$call | ) |
|
|
static |
Parses the calling of a method within a query.
- Parameters
-
DomElement | $call | The tag defining the call. |
- Since
- 4.0.0
- Returns
- array
Definition at line 330 of file DALQueryParser.inc.
static parseChildFields |
( |
DomElement |
$parent | ) |
|
|
staticprotected |
Returns list of fields separated with commas.
Function will look for field tag under parent tag.
- Parameters
-
DomElement | $parent | Fields Node of the XML. |
- Since
- 4.0.0
- Returns
- array
Definition at line 354 of file DALQueryParser.inc.
static parseExistsClause |
( |
DomElement |
$existsCond, |
|
|
|
$level = 0 |
|
) |
| |
|
staticprotected |
Constructs the EXISTS condition from XML node.
array( 'EXISTS' => array( 'CONDITIONS' => array( 'SELECT' => array(), ), ), )
- Parameters
-
DomElement | $existsCond | Select Node of the XML. |
integer | $level | Indentation level. |
- Since
- 4.0.0
- Returns
- array
Definition at line 302 of file DALQueryParser.inc.
static parseInClause |
( |
DomElement |
$inCond, |
|
|
|
$level = 0 |
|
) |
| |
|
staticprotected |
Constructs the IN condition from XML node.
array( 'IN' => array( 'table' => string, 'column' => string, 'CONDITIONS' => array( 0 => string, -— or -— 'SELECT' => array(), ), ), )
- Parameters
-
DomElement | $inCond | Select Node of the XML. |
integer | $level | Indentation level. |
- Since
- 4.0.0
- Returns
- array
Definition at line 247 of file DALQueryParser.inc.
static parseLimitClause |
( |
DomElement |
$select | ) |
|
|
staticprotected |
Constructs the SQL's LIMIT clause from XML node.
Returns the array for the LIMIT clause. array( 'LIMIT' = array( 'rows' => int, 'offset' => int, ), );
- Parameters
-
DomElement | $select | Select Node of the XML. |
- Since
- 4.0.0
- Returns
- array
Definition at line 211 of file DALQueryParser.inc.
static parseMathOperation |
( |
DomElement |
$parent, |
|
|
|
$op = 'MATH-OP' |
|
) |
| |
|
staticprotected |
Returns the array for a math operation block.
- Parameters
-
DomElement | $parent | The math-op element. |
string | $op | Math operator description (i.e. ADD). |
- Since
- 4.0.0
- Returns
- array
Definition at line 437 of file DALQueryParser.inc.
static parseSingleField |
( |
DomElement |
$fieldXML | ) |
|
|
staticprotected |
Returns field array.
This function will first determine which type of field is given. If non found then it will return FALSE.
- Parameters
-
DomElement | $fieldXML | Singel field element. |
- Since
- 4.0.0
- Returns
- (array|boolean)
Definition at line 384 of file DALQueryParser.inc.
static parseSqlFunction |
( |
DomElement |
$function | ) |
|
|
staticprotected |
Converts XML function element to PHP array.
array( 'FUNCTION' => array( 'function' => string, 'ARGS' => array( 0 => mixed, ), ), )
- Parameters
-
DomElement | $function | Function XML node. |
- Since
- 4.0.0
- Returns
- array
Definition at line 486 of file DALQueryParser.inc.
static validateField |
( |
DomElement |
$field, |
|
|
|
$allowAlias = FALSE |
|
) |
| |
|
static |
Validate Field tag.
Field tag must have column and table attribute, and tag node value is only allowed in SELECT clause (for field alias).
- Parameters
-
DomElement | $field | Single field tag. |
boolean | $allowAlias | Allow field alias. |
- Since
- 4.0.0
- Returns
- void
- Exceptions
-
DALParserException | If a field doesn't have a table or a column specified, or if an alias is used incorrectly. |
Definition at line 538 of file DALQueryParser.inc.
static validateFieldsTag |
( |
DomElement |
$fields | ) |
|
|
staticprotected |
Validates INSERT and UDPATE Fields tag.
Throws DALParserException.
- Parameters
-
DomElement | $fields | The query element. |
- Since
- 4.0.0
- Returns
- void
- Exceptions
-
Definition at line 564 of file DALQueryParser.inc.
static validateFunctionTag |
( |
DomElement |
$function | ) |
|
|
static |
Validates a single function tag.
- Parameters
-
DomElement | $function | Single function tag. |
- Since
- 4.0.0
- Returns
- void
- Exceptions
-
Definition at line 703 of file DALQueryParser.inc.
static validateHook |
( |
DomElement |
$hook | ) |
|
|
static |
Validate Hook tag.
Hook tag must have id attribute.
- Parameters
-
DomElement | $hook | Single hook tag. |
- Since
- 4.0.0
- Returns
- void
- Exceptions
-
Definition at line 724 of file DALQueryParser.inc.
static validateValuesTag |
( |
DomElement |
$valuesTag | ) |
|
|
static |
Validates the values tag.
Values tag must have one or more value tags.
- Parameters
-
DomElement | $valuesTag | The values tag. |
- Since
- 4.0.0
- Returns
- void
- Exceptions
-
Definition at line 602 of file DALQueryParser.inc.
static validateValueTag |
( |
DomElement |
$value | ) |
|
|
staticprotected |
Validates a single value tag for update statement.
Value tag must have a column attribute and may contain a math-op tag.
- Parameters
-
DomElement | $value | The value tag. |
- Since
- 4.0.0
- Returns
- void
- Exceptions
-
Definition at line 637 of file DALQueryParser.inc.
The documentation for this class was generated from the following file: