malhal / CloudKit-PHP

For server-to-server comms from PHP to CloudKit.
MIT License
39 stars 10 forks source link

Is there a way to sort a query? #12

Open inPhilly opened 6 years ago

inPhilly commented 6 years ago

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

malhal commented 6 years ago

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;
    }
inPhilly commented 6 years ago

Great - I will give it a try. Thanks!