From cb2e8b225002c7ea00cd2b776a706e581eabd52c Mon Sep 17 00:00:00 2001 From: michael-lefebvre Date: Mon, 14 Apr 2014 21:22:30 +0200 Subject: [PATCH 1/2] fix language and order --- src/Tapioca/Driver.php | 2 +- src/Tapioca/Driver/Rest.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Tapioca/Driver.php b/src/Tapioca/Driver.php index 59ab4b1..459b331 100644 --- a/src/Tapioca/Driver.php +++ b/src/Tapioca/Driver.php @@ -278,7 +278,7 @@ public function reset() $this->_tapioca = array(); $this->_select = array(); $this->_where = array( '_tapioca.status' => 100 ); - $this->_sort = array( '$natural' => -1 ); + $this->_sort = array(); // '$natural' => -1 ); $this->_limit = 99999; $this->_skip = 0; } diff --git a/src/Tapioca/Driver/Rest.php b/src/Tapioca/Driver/Rest.php index d4cc8d3..4296752 100644 --- a/src/Tapioca/Driver/Rest.php +++ b/src/Tapioca/Driver/Rest.php @@ -69,8 +69,13 @@ protected function getRest( $collection = null ) ) ) ); - - $request = static::$rest->get(array( $url . '{?key,q}', $query)); + + if( isset( $this->_where['_tapioca.locale'] ) ) + { + $query['l'] = $this->_where['_tapioca.locale']; + } + + $request = static::$rest->get(array( $url . '{?key,q,l}', $query)); // Send the request and get the response $hash = $this->parseReturn( $request->send()->json() ); @@ -88,9 +93,9 @@ protected function getRest( $collection = null ) $url .= '/' . $this->_ref; $arg = array('l' => null); - if( isset( $this->_tapioca['locale'] ) ) + if( isset( $this->_locale ) ) { - $arg['l'] = $this->_tapioca['locale']; + $arg['l'] = $this->_locale; } $request = static::$rest->get( array( $url . '{?key,l}', $arg ) ); From 24229a975b7569b7bb3ce028b589c7a0971ae65e Mon Sep 17 00:00:00 2001 From: Michael Lefebvre Date: Mon, 14 Apr 2014 21:28:53 +0200 Subject: [PATCH 2/2] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d2a49f7..d3a2b59 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tapioca/client-php" - , "version": "0.2.41" + , "version": "0.3.0" , "type": "library" , "description": "Tapioca PHP client" , "keywords": ["Tapioca", "MongoDb", "CMS"]