From 292dd5e02e5630a82fa74415fba74d1fb847efe7 Mon Sep 17 00:00:00 2001 From: Vitalii Savchuk Date: Thu, 17 Oct 2013 11:07:17 +0300 Subject: [PATCH] fix tests --- src/Bazalt/Rest/Collection.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bazalt/Rest/Collection.php b/src/Bazalt/Rest/Collection.php index 956fcad..dd4be5e 100644 --- a/src/Bazalt/Rest/Collection.php +++ b/src/Bazalt/Rest/Collection.php @@ -84,11 +84,11 @@ public function exec($params = []) $this->collection->countPerPage((int)$params['count']); } - public function fetch($params = [], $callback = null, $className = null) + public function fetch($params = array(), $callback = null, $className = null) { $this->exec($params); - $return = []; + $return = array(); $result = $this->collection->fetchPage($className); foreach ($result as $k => $item) { @@ -109,15 +109,15 @@ public function fetch($params = [], $callback = null, $className = null) $return[$k] = $res; } - $data = [ + $data = array( 'data' => $return, - 'pager' => [ + 'pager' => array( 'current' => $this->collection->page(), 'count' => $this->collection->getPagesCount(), 'total' => $this->collection->count(), 'countPerPage' => $this->collection->countPerPage() - ] - ]; + ) + ); //$data['sql'] = $this->collection->toSQL(); return $data; }