13 require_once
'DAL/Parsers/DALQueryParser.inc';
14 require_once
'DAL/DALBaker.inc';
15 require_once
'DAL/Parsers/DALWhereParser.inc';
38 private function __construct()
58 public static function parse(DomElement $xmlQuery)
61 $deleteTag = $xmlQuery->getElementsByTagName(
'truncate')->item(0);
63 if ($deleteTag !== NULL) {
64 $query[
'TRUNCATE'] = array();
67 $tableTag = $deleteTag->getElementsByTagName(
'table')->item(0);
68 $query[
'TRUNCATE'][
'from'] = $tableTag->nodeValue;
89 public static function validate(DomElement $query)
91 $deleteTag = $query->getElementsByTagName(
'truncate')->item(0);
92 if ($deleteTag === NULL) {
97 $tableTag = $deleteTag->getElementsByTagName(
'table')->item(0);
98 if ($tableTag === NULL) {
99 $msg =
'Truncate queries must have a table tag, specifying the table to be cleared.';
101 }
else if (trim($tableTag->nodeValue) ===
'') {
102 $msg =
'Truncate queries must have a table tag, specifying the table to be cleared.';