public function prepareSort(array $fields) : array
    {
        $sortFields = [];

        foreach ($fields as $key => $value) {
            if (is_array($value)) {
                $sortFields[$this->prepareFieldName($key)] = $value;
            } else {
                $sortFields[$this->prepareFieldName($key)] = $this->getSortDirection($value);
            }
        }

        return $sortFields;
    }
public function prepareSort(array $fields) : array
    {
        $sortFields = [];

        foreach ($fields as $key => $value) {
            if (is_array($value)) {
                $sortFields[$this->prepareFieldName($key)] = $value;
            } else {
                $sortFields[$this->prepareFieldName($key)] = $this->getSortDirection($value);
            }
        }

        return $sortFields;
    }
public function prepareSort ( array $ fields ) : array { $ sortFields = [ ] ; foreach ( $ fields as $ key => $ value ) { if ( is_array ( $ value ) ) { $ sortFields [ $ this -> prepareFieldName ( $ key ) ] = $ value ; } else { $ sortFields [ $ this -> prepareFieldName ( $ key ) ] = $ this -> getSortDirection ( $ value ) ; } } return $ sortFields ; }
Prepare a sort specification array by converting keys to MongoDB field
names and changing direction strings to int.
Prepare a sort specification array by converting keys to MongoDB field names and changing direction strings to int .