13 require_once
'DAL/Parsers/DALQueryParser.inc';
14 require_once
'DAL/Parsers/DALSelectParser.inc';
15 require_once
'DAL/Parsers/DALWhereParser.inc';
16 require_once
'DAL/Parsers/DALUnionParser.inc';
36 private function __construct()
59 public static function parse(DomElement $xmlQuery)
62 $withTag = $xmlQuery->getElementsByTagName(
'with')->item(0);
64 $query[
'WITH'] = self::parseSqlFunction($withTag);
69 $after = $withTag->getElementsByTagName(
'after')->item(0);
73 $connectBy = $withTag->getElementsByTagName(
'connect-by-prior')->item(0);
75 $query[
'WITH'][
'CONNECT-BY-PRIOR'] = current(
DALWhereParser::parse($connectBy->parentNode,
'connect-by-prior'));
90 public static function validate(DomElement $xmlQuery)
116 $query[
'FUNCTION'] = array();
117 $query[
'FUNCTION'][
'function'] = $function->getAttribute(
'function');
118 $query[
'FUNCTION'][
'ARGS'] = array();
120 if ($function->getAttribute(
'alias') !==
'') {
121 $query[
'FUNCTION'][
'alias'] = $function->getAttribute(
'alias');
124 $argsTag = $function->getElementsByTagName(
'args')->item(0);
125 $argTags = $argsTag->getElementsByTagName(
'arg');
127 foreach ($argTags as $arg) {
128 $query[
'FUNCTION'][
'ARGS'][] = $arg->nodeValue;