13 require_once
'DAL/Parsers/DALQueryParser.inc';
14 require_once
'DAL/Parsers/DALUnionParser.inc';
15 require_once
'DAL/Parsers/DALSelectParser.inc';
16 require_once
'DAL/DALBaker.inc';
17 require_once
'XML/XML.inc';
38 private function __construct()
59 public static function parse(DomElement $fromTag)
61 if ($fromTag->tagName !==
'from') {
62 $fromTag = $fromTag->getElementsByTagName(
'from')->item(0);
66 if ($fromTag !== NULL) {
67 $from[
'FROM'] = array();
70 $unionTag = self::getUnionTag($fromTag);
71 if ($unionTag !== NULL) {
75 foreach ($fromTag->childNodes as $table) {
76 if ($table->nodeType !== XML_ELEMENT_NODE) {
81 if ($table->tagName ===
'hook') {
84 $from[
'FROM'][] = $hook;
85 }
else if ($table->tagName ===
'table') {
88 $tblSelect = $table->getElementsByTagName(
'select')->item(0);
89 if ($tblSelect !== NULL) {
92 $tableInfo[
'name'] = $table->nodeValue;
96 if ($table->getAttribute(
'alias') !==
'') {
97 $tableInfo[
'alias'] = $table->getAttribute(
'alias');
100 if (isset($tableInfo[
'alias']) === TRUE) {
101 $from[
'FROM'][] = $tableInfo;
103 $from[
'FROM'][] = $tableInfo[
'name'];
105 }
else if ($table->tagName ===
'function') {
106 self::validateFunctionTag($table);
107 $from[
'FROM'][] = self::parseSqlFunction($table);