13 require_once
'DAL/Parsers/DALQueryParser.inc';
14 require_once
'XML/XML.inc';
35 private function __construct()
59 public static function parse(DomElement $parent)
62 $groupBy = $parent->getElementsByTagName(
'group-by')->item(0);
63 if ($groupBy !== NULL) {
64 if ($groupBy->hasChildNodes() === TRUE) {
65 $query[
'GROUP-BY'] = self::parseChildFields($groupBy);
86 public static function validate(DomElement $select)
89 $groupBy = $select->getElementsByTagName(
'group-by')->item(0);
90 if ($groupBy !== NULL) {
98 if (count($tags) === 0) {
99 $msg =
'group-by tag must have at least one field or hook.';
102 foreach ($tags as $tag) {
103 if ($tag->tagName ===
'field') {
104 self::validateField($tag);
105 }
else if ($tag->tagName ===
'hook') {
106 self::validateHook($tag);