dbFactory - ThomasDC84/Proteus GitHub Wiki

Class dbFactory

This class is used to create an object of it by the core and it is used to creating objects with active connection to a database. It is possible to create multiple objects and different kind of database type are supported. For now it supports MySQL and SQlite database types, it will supports more in the future.

Methods

Here is the list of the available methods of the class.

setConfigurationFile($configurationFile)

This method will overwrite the configuration file that will be used to create the connection objects to the database. The parameter must be a string containing the path to a configuration file;

buildDataBase($dbType, $dbName)

Depending on the first parameter, this method will return an object with a connection to specified database type, if the database type it is not supported, false value will be returned. It is possible to change the database name selected for the connection;

buildDefaultDataBase()

It does quite the same thing of the previous method, but this one does not accept any parameter because it will only return a connection object using the default parameters.