Return the database adapter used for the DAO's entity.

@return IConnector
439588
final public function db() {
        if (!$this->connector) {
            $this->connector = $this->getWorker()->getConnector();
        }
        return $this->connector;
    }
328030
public function _getEntityManager()
    {
        if ($this->kernel === null) {
            $this->fail('Symfony2 platform module is not loaded');
        }
        if (!isset($this->permanentServices[$this->config['em_service']])) {
            // try to persist configured EM
            $this->persistService($this->config['em_service'], true);

            if ($this->_getContainer()->has('doctrine')) {
                $this->persistService('doctrine', true);
            }
            if ($this->_getContainer()->has('doctrine.orm.default_entity_manager')) {
                $this->persistService('doctrine.orm.default_entity_manager', true);
            }
            if ($this->_getContainer()->has('doctrine.dbal.backend_connection')) {
                $this->persistService('doctrine.dbal.backend_connection', true);
            }
        }
        return $this->permanentServices[$this->config['em_service']];
    }
55042
public function getImporter()
	{
		// Derive the class name from the driver.
		$class = '\\Joomla\\Database\\' . ucfirst($this->name) . '\\' . ucfirst($this->name) . 'Importer';

		// Make sure we have an importer class for this driver.
		if (!class_exists($class))
		{
			// If it doesn't exist we are at an impasse so throw an exception.
			throw new \RuntimeException('Database Importer not found');
		}

		/* @var  $o  DatabaseImporter */
		$o = new $class;
		$o->setDbo($this);

		return $o;
	}
979750
public function getConnection()
    {
        if ($this->_oConn === null) {
            $this->_oConn = $this->openDatabase(null);
        }

        return $this->_oConn;
    }
1158267
public function createDoctrineAdapter($adapterClass = null, $entityManagerName = null)
    {
        if (null == $adapterClass) {
            $adapterClass = 'Lexik\Bundle\CurrencyBundle\Adapter\DoctrineCurrencyAdapter';
        }
        $adapter = $this->create($adapterClass);

        $em = $this->doctrine->getManager($entityManagerName);
        $adapter->setManager($em);

        return $adapter;
    }
676239
public function getConnection()
    {
        // Autre BDD que celle par defaut. soit avec un autre connector de la config, ou avec autre ID de connexion de la config
        if ($this->dbConnector !== null || count($this->idConnection) > 0) {
            $dbConnector = ($this->dbConnector !== null) ? $this->dbConnector : Config::get()['connection'];
            $connector = 'DawPhpOrm\Database\Connectors\\'.ucfirst($dbConnector).'Connector';

            $db = new $connector($this->idConnection);
            
            return $db->getConnection();
        }

        // BDD par defaut avec connector de config et avec ID de config
        if (self::$connection === null) {
            $connector = 'DawPhpOrm\Database\Connectors\\'.ucfirst(Config::get()['connection']).'Connector';

            $db = new $connector();
            self::$connection = $db->getConnection();
        }

        return self::$connection;
    }
500407
public static function getDatabaseConfigurationHelper($databaseClass)
    {
        $adapters = static::get_adapters();
        if (empty($adapters[$databaseClass]) || empty($adapters[$databaseClass]['helperClass'])) {
            return null;
        }

        // Load if path given
        if (isset($adapters[$databaseClass]['helperPath'])) {
            include_once $adapters[$databaseClass]['helperPath'];
        }

        // Construct
        $class = $adapters[$databaseClass]['helperClass'];
        return (class_exists($class)) ? new $class() : null;
    }
1059902
protected function getTransactionManager()
    {
        if (!$this->transactionManager) {
            // PDOConnector providers this
            if ($this->connector instanceof TransactionManager) {
                $this->transactionManager = new NestedTransactionManager($this->connector);
            // Direct database access does not
            } else {
                $this->transactionManager = new NestedTransactionManager(new MySQLTransactionManager($this));
            }
        }
        return $this->transactionManager;
    }
718239
public function getAdapter()
    {
        $adapter = $this->dsn->adapter;

        if ($adapter !== null) {
            return $adapter;
        }

        $scheme = $this->dsn->scheme;

        if (isset(static::$adapterMap[$scheme])) {
            return static::$adapterMap[$scheme];
        }

        return null;
    }
867002
public function getDefaultConnection()
    {
        $config = Config::getEnv('database.default');

        if (empty($config)) {
            throw new \InvalidArgumentException("'database'配置文件中的'default'配置项无效：该配置必须是非空数组");
        }

        $driver_str = isset($config->driver) ? $config->driver : null;
        $driver = strtolower($driver_str);
        unset($config->driver);

        $config = (array) $config;
        $config['options'] = [
            \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
            \PDO::ATTR_EMULATE_PREPARES => false,
            \PDO::ATTR_STRINGIFY_FETCHES => false,
            \PDO::ATTR_DEFAULT_FETCH_MODE => $this->getDefaultFetch(),
        ];

        return new ConnectionObj('db', $driver, $config);
    }
19580
public function getSQLAdapter() {
		return $this->sqlAdapter ? $this->sqlAdapter :
			($this->transactionOperationSet ? $this->transactionOperationSet->getSQLAdapter() : null);
	}
1059944
protected function getAdapterFactory()
    {
        if (!isset($this->factoryCache[$this->id])) {
            $config = config('jwt');
            if (isset($this->config['adapter'])) {
                $config = array_merge($config, $this->config['adapter']);
            }
            $factoryClass = $this->getAdapterFactoryClass();
            $this->factoryCache[$this->id] = new $factoryClass($config);
        }
        return $this->factoryCache[$this->id];
    }
671513
protected static function getFacadeAccessor()
    {
    	$viewPath = dirname(dirname(dirname(__DIR__)));
        $adapter = new Local($viewPath);
        $filesystem = new Filesystem($adapter);
        return $filesystem;
    }
1224848
public function getDatabaseAdapter() {
        try {             
            if (isset($this->db)) {
                return $this->db;
            }
            
            $config = $this->reader->getDbsConfig();
            
            if ( !isset($config['influx']) 
                    || !isset($config['influx']["username"]) 
                    || !isset($config['influx']["password"]) 
                    || !isset($config['influx']["host"]) 
                    || !isset($config['influx']["port"]) 
                    || !isset($config['influx']["database"]) ) {
                throw new Exception("Influx config is not valid!");
            }
            
            $username = $config['influx']["username"];
            $password = $config['influx']["password"];
            $host = $config['influx']["host"];
            $port = $config['influx']["port"];
            $dbname = $config['influx']["database"];
        
            $client = new \InfluxDB\Client($host, $port, $username, $password);
            $this->db = $client->selectDB($dbname);
            return $this->db;
        } catch (Exception $ex) {
            print("ERROR:" . $ex->getMessage());
            throw new Exception("Faild connect to influx db!");
        }
    }
1127837
public function get_dbengine() {
        if (isset($this->dboptions['dbengine'])) {
            return $this->dboptions['dbengine'];
        }

        if ($this->external) {
            return null;
        }

        $engine = null;

        // Look for current engine of our config table (the first table that gets created),
        // so that we create all tables with the same engine.
        $sql = "SELECT engine
                  FROM INFORMATION_SCHEMA.TABLES
                 WHERE table_schema = DATABASE() AND table_name = '{$this->prefix}config'";
        $this->query_start($sql, NULL, SQL_QUERY_AUX);
        $result = $this->mysqli->query($sql);
        $this->query_end($result);
        if ($rec = $result->fetch_assoc()) {
            // MySQL 8 BC: information_schema.* returns the fields in upper case.
            $rec = array_change_key_case($rec, CASE_LOWER);
            $engine = $rec['engine'];
        }
        $result->close();

        if ($engine) {
            // Cache the result to improve performance.
            $this->dboptions['dbengine'] = $engine;
            return $engine;
        }

        // Get the default database engine.
        $sql = "SELECT @@default_storage_engine engine";
        $this->query_start($sql, NULL, SQL_QUERY_AUX);
        $result = $this->mysqli->query($sql);
        $this->query_end($result);
        if ($rec = $result->fetch_assoc()) {
            $engine = $rec['engine'];
        }
        $result->close();

        if ($engine === 'MyISAM') {
            // we really do not want MyISAM for Moodle, InnoDB or XtraDB is a reasonable defaults if supported
            $sql = "SHOW STORAGE ENGINES";
            $this->query_start($sql, NULL, SQL_QUERY_AUX);
            $result = $this->mysqli->query($sql);
            $this->query_end($result);
            $engines = array();
            while ($res = $result->fetch_assoc()) {
                if ($res['Support'] === 'YES' or $res['Support'] === 'DEFAULT') {
                    $engines[$res['Engine']] = true;
                }
            }
            $result->close();
            if (isset($engines['InnoDB'])) {
                $engine = 'InnoDB';
            }
            if (isset($engines['XtraDB'])) {
                $engine = 'XtraDB';
            }
        }

        // Cache the result to improve performance.
        $this->dboptions['dbengine'] = $engine;
        return $engine;
    }
112999
public function getAdapter() {
		if ($this->_adapter === null) {
			if ($this->hasLocator()) {
				$this->_adapter = $this->getLocator()->get($this->getAdapterName());
			} else {
				throw new Exceptions\NoAdapter('Nor a database adapter neither a services locator has been provided');
			}
		}
		
		return $this->_adapter;
	}
264353
public function getExporter()
	{
		// Derive the class name from the driver.
		$class = '\\Joomla\\Database\\' . ucfirst($this->name) . '\\' . ucfirst($this->name) . 'Exporter';

		// Make sure we have an exporter class for this driver.
		if (!class_exists($class))
		{
			// If it doesn't exist we are at an impasse so throw an exception.
			throw new \RuntimeException('Database Exporter not found.');
		}

		/* @var  $o  DatabaseExporter */
		$o = new $class;
		$o->setDbo($this);

		return $o;
	}