Karaka-Management / phpOMS

PHP Framework
Other
2 stars 0 forks source link

It looks like that only one sort parameter is supported #364

Open spl1nes opened 7 months ago

spl1nes commented 7 months ago

An sql ORDER BY can have multiple columns specified for ordering.

ORDER BY col1 DESC, col2 ASC, col3 DESC

The data mapper appears to not support this:

foreach ($data as $sort) {
      if (($column = $this->mapper::getColumnByMember($member)) === null
          || ($sort['child'] !== '')
      ) {
          continue;
      }

      $query->orderBy($this->mapper::TABLE . '_d' . $this->depth . $this->joinAlias . '.' . $column, $sort['order']);

      break; // there is only one root element (one element with child === '')
  }