use args consistently. needs to be refactored to use a dependency injector eventually
authorChuck Hagenbuch <chuck@horde.org>
Sat, 27 Dec 2008 04:02:10 +0000 (23:02 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 27 Dec 2008 04:02:10 +0000 (23:02 -0500)
content/lib/Objects/Manager.php
content/lib/Types/Manager.php
content/lib/Users/Manager.php

index 7dc466f..d9225e9 100644 (file)
@@ -45,13 +45,17 @@ class Content_Objects_Manager
      */
     public function __construct($context = array())
     {
+        if (!empty($context['dbAdapter'])) {
+            $this->_db = $context['dbAdapter'];
+        }
+
         if (!empty($params['typeManager'])) {
             $this->_typeManager = $params['typeManager'];
         }
     }
 
     /**
-     *
+     * Set the database connection.
      *
      * @param Horde_Db $db  The database connection
      */
index 0cd26ff..35d379a 100644 (file)
@@ -34,7 +34,9 @@ class Content_Types_Manager
 
     public function __construct($context = array())
     {
-        $this->_db = $adapter;
+        if (!empty($context['dbAdapter'])) {
+            $this->_db = $context['dbAdapter'];
+        }
     }
 
     /**
index cc295e4..638e28b 100644 (file)
@@ -32,9 +32,11 @@ class Content_Users_Manager
         'users' => 'rampage_users',
     );
 
-    public function __construct($adapter, $params = array())
+    public function __construct($context = array())
     {
-        $this->_db = $adapter;
+        if (!empty($context['dbAdapter'])) {
+            $this->_db = $context['dbAdapter'];
+        }
     }
 
     /**