13 require_once
'DAL/Parsers/DALQueryParser.inc';
14 require_once
'DAL/DALBaker.inc';
15 require_once
'DAL/Parsers/DALWhereParser.inc';
36 private function __construct()
57 public static function parse(DomElement $xmlQuery)
60 $deleteTag = $xmlQuery->getElementsByTagName(
'delete')->item(0);
62 if ($deleteTag !== NULL) {
63 $query[
'DELETE'] = array();
66 $whereTag = $deleteTag->getElementsByTagName(
'where')->item(0);
69 $length = $whereTag->childNodes->length;
71 while ($i < $length) {
72 $cond = $whereTag->childNodes->item($i);
75 if ($cond->nodeType !== XML_ELEMENT_NODE) {
80 $deleteFrom = $cond->getAttribute(
'table');
84 $length = $whereTag->childNodes->length;
89 $query[
'DELETE'][
'from'] = $deleteFrom;
93 $query[
'DELETE'] = array_merge($query[
'DELETE'], $whereCond);
116 $deleteTag = $query->getElementsByTagName(
'delete')->item(0);
117 if ($deleteTag === NULL) {
122 $whereTag = $deleteTag->getElementsByTagName(
'where')->item(0);
123 if ($whereTag === NULL) {
124 $msg =
'Delete query must have a where tag.';