public function orderBy($fields)
{
$this->orderBy = (array) $fields;
return $this;
}
public function testOrdering() { $path = __DIR__ . '/fixtures/datastore/querytest'; $config = new Config($path . '/'); $repo = new Repository('countries', $config); $query = new Query($repo); $query->orderBy('capital DESC'); $result = $query->execute(); $this->assertEquals('Croatia', $result->first()->id); $this->assertEquals('Heard Island and McDonald Islands', $result[$result->count() - 1]->id); }