Support order_default attribute to <index> tag in XML query

This commit is contained in:
Kijin Sung 2022-12-18 01:18:55 +09:00
parent 2a3f5d3c51
commit 4cc730e489
4 changed files with 12 additions and 10 deletions

View file

@ -190,10 +190,12 @@ class DBQueryParser extends BaseParser
$query->navigation = new DBQuery\Navigation;
foreach ($xml->navigation->index ?: [] as $tag)
{
$attribs = self::_getAttributes($tag, true);
$orderby = new DBQuery\OrderBy;
$orderby->var = trim($tag['var']) ?: null;
$orderby->default = trim($tag['default']) ?: null;
$orderby->order_var = trim($tag['order']) ?: null;
$orderby->var = ($attribs['var'] ?? null) ?: null;
$orderby->default = ($attribs['default'] ?? null) ?: null;
$orderby->order_var = ($attribs['order'] ?? null) ?: null;
$orderby->order_default = strtoupper($attribs['orderdefault'] ?? '') === 'DESC' ? 'DESC' : 'ASC';
$query->navigation->orderby[] = $orderby;
}
foreach (['list_count', 'page_count', 'page', 'offset'] as $key)