ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilDBWrapperFactory Class Reference

Class ilDBWrapperFactory. More...

+ Collaboration diagram for ilDBWrapperFactory:

Static Public Member Functions

static getWrapper (string $a_type)
 

Detailed Description

Class ilDBWrapperFactory.

DB Wrapper Factory. Delivers a DB wrapper object depending on given DB type and DSN.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 36 of file ilDBWrapperFactory.php.

Member Function Documentation

◆ getWrapper()

static ilDBWrapperFactory::getWrapper ( string  $a_type)
static
Parameters
string$a_type
Returns
ilDBPdoInterface
Exceptions
ilDatabaseException

Definition at line 43 of file ilDBWrapperFactory.php.

44 {
45 $ilDB = new ilDBPdo(match ($a_type) {
46 'pdo-mysql-innodb', ilDBConstants::TYPE_INNODB => new InnoDBDetails(),
48 default => throw new ilDatabaseException("No viable database-type given: " . var_export($a_type, true)),
49 });
50
51 return $ilDB;
52 }
Class ilDatabaseException.
Interface ilDBPdoInterface.

References $ilDB, ilDBConstants\TYPE_GALERA, and ilDBConstants\TYPE_INNODB.

Referenced by ilDatabaseCreatedObjective\achieve(), ilDatabaseExistsObjective\achieve(), ilDatabaseInitializedObjective\achieve(), ilDatabaseServerIsConnectableObjective\achieve(), ilSoapInstallationInfoXMLWriter\buildClient(), ilInitialisation\initDatabase(), and ilDatabaseCreatedObjective\isApplicable().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: