/** * Get a database driver object. * * @return DatabaseDriver * * @since 1.0 */ public function getDatabase() { if (is_null($this->database)) { $this->database = DatabaseDriver::getInstance(array('driver' => $this->get('database.driver'), 'host' => $this->get('database.host'), 'user' => $this->get('database.user'), 'password' => $this->get('database.password'), 'database' => $this->get('database.name'), 'prefix' => $this->get('database.prefix'))); // @todo Decouple from Factory Factory::$database = $this->database; } return $this->database; }