From 12c386217765025a88b3a370287f1bf13a1e9642 Mon Sep 17 00:00:00 2001 From: bethrezen Date: Mon, 21 Jul 2014 12:52:16 +0400 Subject: [PATCH] Simple sorting --- ArangoProvider.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ArangoProvider.php b/ArangoProvider.php index 2b12901..2d33500 100644 --- a/ArangoProvider.php +++ b/ArangoProvider.php @@ -20,6 +20,8 @@ class ArangoProvider extends yii\data\ActiveDataProvider */ public $params = []; + public $sort = ''; + public function init() { parent::init(); @@ -116,6 +118,11 @@ class ArangoProvider extends yii\data\ActiveDataProvider if (count($filter)>0){ $query .= "\nFILTER ".implode(" && ", $filter)."\n"; } + + if ($this->sort) { + $query .= "\n SORT a." . $this->sort; + } + $statement = $this->arango->statement([ 'query' => $query, 'count' => true,