CloudKit-PHP icon indicating copy to clipboard operation
CloudKit-PHP copied to clipboard

Is there a way to sort a query?

Open inPhilly opened this issue 7 years ago • 2 comments

I see that a query can be filtered, but can it be sorted?

inPhilly avatar Apr 20 '18 15:04 inPhilly

I took a quick look at the CloudKit web services reference document and came up with this method, try adding it to Query.php

    public function sort($fieldName, $ascending = true){ // todo relativeLocation
        $this->sorters[] = ['fieldName' => $fieldName,
                            'ascending' => $ascending
                            ];
        return $this;
    }

malhal avatar Apr 20 '18 15:04 malhal

Great - I will give it a try. Thanks!

inPhilly avatar Apr 20 '18 19:04 inPhilly