From cbed71c86e84e3349483d6c54e049ec9449f400d Mon Sep 17 00:00:00 2001 From: Sam Millman Date: Mon, 9 Jan 2017 13:24:55 +0000 Subject: [PATCH] Bug fix for Query --- Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Query.php b/Query.php index 50ad590..aabd371 100644 --- a/Query.php +++ b/Query.php @@ -336,7 +336,7 @@ public function getDbConnection() public function setDb($db) { if($db instanceof Database){ - $this->databaseName = $db->database->getDatabaseName(); + $this->databaseName = $db->getDatabaseName(); }elseif($db instanceof MongoDatabase){ $this->databaseName = $db->getDatabaseName(); }else{ @@ -349,7 +349,7 @@ public function getDb() $name = $this->databaseName; if($this->model){ // Get DB name from model - $name = $this->model->getCollection()->database->getDatabaseName(); + $name = $this->model->getCollection()->getDatabaseName(); } // Will select default database if name is null