Database service

Database connections are available from the Service container.

Current site database connection

To get the current site's database connection from the service container:

$db = Jadu_Service_Container::getInstance()->getSiteDB();

Main site database connection

To get the main site's database connection, even when executing code on a Galaxies site:

$mainDb = Jadu_Service_Container::getInstance()->getMainDB();

Named site database connection

To get the database connection for a named site:

$siteDb = Jadu_Service_Container::getInstance()->getConnectionForSiteURL('');

results matching ""

    No results matching ""