Skip to content

database helper compatible with database api

Compare
Choose a tag to compare
@dcblogdev dcblogdev released this 29 May 13:12
· 1805 commits to master since this release

This pull request improve the Helpers\Database and integrate it with the Database API, making possible to use it even when Database API is used too, without to duplicate the database connections.

The single visible change in API is that the optional parameter of the method Database::get() is now a string, defaulting to 'default', and indicating the Database API configuration entry used, instead of being a configuration array. Usage is simple:

// Get the default Database instance
$db = Database::get();

// Get a custom configured Database instance
$customDb = Database::get('custom');

To note that the API remains unchanged in the rest.