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 $orderBy = $parent->getElementsByTagName(
'order-by')->item(0);
63 if ($orderBy !== NULL && $orderBy->parentNode === $parent) {
64 $query[
'ORDER-BY'] = self::parseChildFields($orderBy);
65 if ($orderBy->getAttribute(
'direction') !==
'') {
66 $query[
'ORDER-BY'][
'direction'] = $orderBy->getAttribute(
'direction');
86 public static function validate(DomElement $select)
89 $orderBy = $select->getElementsByTagName(
'order-by')->item(0);
90 if ($orderBy !== NULL) {
98 if (count($tags) === 0) {
99 $msg =
'order-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);