src/Request.php
protected function executeOrderBy(array $data, array $keys)
    {
        $keyLength = count($keys);

        if (!$keys) {
            return $data;
        }

        foreach ($keys as &$value) {
            $value = $value == 'desc' || $value == -1
                ? -1
                : ($value == 'skip' || $value === 0
                ? 0
                : 1);
        }

        usort($data, function ($a, $b) use ($keys, $keyLength) {
            $sorted = 0;
            $ix     = 0;

            while ($sorted === 0 && $ix < $keyLength) {
                $k = $this->obIx($keys, $ix);
                if ($k) {
                    $dir    = $keys[ $k ];
                    $sorted = $this->keySort($a[ $k ], $b[ $k ], $dir);
                    $ix++;
                }
            }

            return $sorted;
        });

        return $data;
    }
protected function executeOrderBy(array $data, array $keys)
    {
        $keyLength = count($keys);

        if (!$keys) {
            return $data;
        }

        foreach ($keys as &$value) {
            $value = $value == 'desc' || $value == -1
                ? -1
                : ($value == 'skip' || $value === 0
                ? 0
                : 1);
        }

        usort($data, function ($a, $b) use ($keys, $keyLength) {
            $sorted = 0;
            $ix     = 0;

            while ($sorted === 0 && $ix < $keyLength) {
                $k = $this->obIx($keys, $ix);
                if ($k) {
                    $dir    = $keys[ $k ];
                    $sorted = $this->keySort($a[ $k ], $b[ $k ], $dir);
                    $ix++;
                }
            }

            return $sorted;
        });

        return $data;
    }
Trie le tableau en fonction des clés paramétrés.

@param array $data Données à trier.
@param array $keys Clés sur lesquelles le trie s'exécute.

@return array les données triées