13 require_once
'DAL/Parsers/DALQueryParser.inc';
14 require_once
'DAL/Parsers/DALSelectParser.inc';
15 require_once
'DAL/DALBaker.inc';
36 private function __construct()
58 public static function parse(DomElement $xmlQuery)
62 $unionTag = $xmlQuery->getElementsByTagName(
'union')->item(0);
63 if ($unionTag === NULL) {
64 $unionTag = $xmlQuery->getElementsByTagName(
'union-all')->item(0);
65 if ($unionTag === NULL) {
71 $tag = strtoupper($unionTag->tagName);
72 $query[$tag] = array();
75 if ($unionTag->getAttribute(
'alias') !==
'') {
76 $query[$tag][
'alias'] = $unionTag->getAttribute(
'alias');
79 $query[$tag][
'SELECTS'] = array();
82 foreach ($unionTag->childNodes as $node) {
83 if ($node->nodeType !== XML_ELEMENT_NODE) {
87 if ($node->tagName ===
'select') {
89 }
else if ($node->tagName ===
'hook') {
91 $query[$tag][
'SELECTS'][] = $hookid;