Browse Source

Removing database host
@TODO: cazzo, rimetterlo in qualche modo...

Paolo Libertini 6 years ago
parent
commit
9b0a8ceef8
1 changed files with 14 additions and 14 deletions
  1. 14 14
      lib/Mooses/AbstractMongo.php

+ 14 - 14
lib/Mooses/AbstractMongo.php

@@ -221,22 +221,22 @@ class Mooses_AbstractMongo extends Mooses_Mongodb_Mongo_Document {
 //        $_cacher = Mooses_Cacher::getInstance(strtolower("p_".str_replace("Default_Model_Mapper", "", get_called_class())), 3600);
 //        $_idCache = preg_replace("/[^a-zA-Z0-9_]+/", "", "query_" . json_encode($this->_queryConditions));
 //        if($this->_forceNoCachePaginatedCollection === true || !$_arrayResults = $_cacher->load($_idCache)) {
-//            $_result = $this->fetchAll($this->_queryConditions, $this->_fields);
-//            if (count($this->_sorterArray) == 0) {
-//                $_arrayResults = $this->_convertMongoCursor($_result, true);
-//            } else {
-//                $_arrayResults = $this->_convertMongoCursor($_result, true, $this->_sorterArray);
-//            }
+            $_result = $this->fetchAll($this->_queryConditions, $this->_fields);
+            if (count($this->_sorterArray) == 0) {
+                $_arrayResults = $this->_convertMongoCursor($_result, true);
+            } else {
+                $_arrayResults = $this->_convertMongoCursor($_result, true, $this->_sorterArray);
+            }
 //            $_cacher->save($_arrayResults, $_idCache);
 //        }
-//        if(count($_arrayResults) > 0) {
-//            $_paginatorAdapter = new Zend_Paginator_Adapter_Array($_arrayResults);
-//            $_paginator = new Zend_Paginator($_paginatorAdapter);
-//            $_paginator->setItemCountPerPage($_itemsPerPage)->setCurrentPageNumber($_page);
-//            return $_paginator;
-//        } else {
-//            return false;
-//        }
+        if(count($_arrayResults) > 0) {
+            $_paginatorAdapter = new Zend_Paginator_Adapter_Array($_arrayResults);
+            $_paginator = new Zend_Paginator($_paginatorAdapter);
+            $_paginator->setItemCountPerPage($_itemsPerPage)->setCurrentPageNumber($_page);
+            return $_paginator;
+        } else {
+            return false;
+        }
     }
 
     protected function ___setCollectionOrder($_sorterArray){