/** * Return new LudoDB object with connection to the database. * @return LudoDB|LudoDBMySql|LudoDBMySqlI|LudoDBPDO */ public static function getInstance() { if (!isset(self::$instance)) { switch (self::$connectionType) { case self::ADAPTER_PDO: self::$instance = new LudoDBPDO(); break; case self::ADAPTER_MYSQLI: self::$instance = new LudoDBMySqlI(); break; case self::ADAPTER_PDO_ORACLE: self::$instance = new LudoDBPDOOracle(); break; default: self::$instance = new LudoDBMySql(); } self::$instance->connect(); } return self::$instance; }