Permalink
Browse files

Merge pull request #20 from jaceju/master

Add multiple configures support
  • Loading branch information...
2 parents 72d6c69 + e022dc2 commit 48308a4aa8024b2e620201fc29c2fddbb0cb41ee @hpaul committed Dec 21, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 model.php
  2. +3 −3 mongodb.php
View
@@ -21,7 +21,7 @@ class Model {
*
* @var string
*/
- public $connection = 'mongor';
+ public $connection = 'database';
/**
* Indicates if the model exists in the database.
@@ -115,7 +115,7 @@ public function __construct($connection = NULL)
if (is_string($this->connection))
{
- $this->connection = new MongoDB;
+ $this->connection = new MongoDB($this->connection);
}
if (is_null(static::$collection))
View
6 mongodb.php 100755 → 100644
@@ -43,12 +43,12 @@ class MongoDB {
* @param $name
* @param array $config
*/
- public function __construct()
+ public function __construct($config_name = 'database')
{
- $this->_config = Config::get('mongor::database');
+ $this->_config = Config::get('mongor::' . $config_name);
- $this->connect();
+ $this->connect();
return $this;
}

0 comments on commit 48308a4

Please sign in to comment.