/** * @param $name * @return Database * @throws DatabaseTypeNotSupported * @throws \BigName\BackupManager\Config\ConfigNotFoundForConnection */ public function get($name) { $type = $this->config->get($name, 'type'); foreach ($this->databases as $database) { if ($database->handles($type)) { $database->setConfig($this->config->get($name)); return $database; } } throw new DatabaseTypeNotSupported("The requested database type {$type} is not currently supported."); }
/** * @param $name * @param null $key * @throws \BigName\BackupManager\Config\ConfigFieldNotFound * @throws \BigName\BackupManager\Config\ConfigNotFoundForConnection * @return mixed */ public function getConfig($name, $key = null) { return $this->config->get($name, $key); }