protected function __construct() { // Set the $_db to the static $_usedb // The static $_usedb thus determines which db future Sprig instances will have // Example: Sprig_Wi3::$_usedb = Database::instance("name", $config); $obj = Sprig_Wi3::factory(""); ... more Sprig_Wi3 models if (!empty(self::$_usedb)) { $this->_db = self::$_usedb; } // Now construct the Sprig return parent::__construct(); }