class DatabaseManager (View source)

internal  Class is subject to breaking changes in minor and patch versions.
 

Properties

protected Application $app
protected DatabaseManager $database
protected Repository $config

Methods

__construct(Application $app, DatabaseManager $database, Repository $config)

No description

connectToTenant(TenantWithDatabase $tenant)

Connect to a tenant's database.

reconnectToCentral()

Reconnect to the default non-tenant connection.

setDefaultConnection(string $connection)

Change the default database connection config.

createTenantConnection(TenantWithDatabase $tenant)

Create the tenant database connection.

purgeTenantConnection()

Purge the tenant database connection.

void
ensureTenantCanBeCreated(TenantWithDatabase $tenant)

Check if a tenant can be created.

Details

__construct(Application $app, DatabaseManager $database, Repository $config)

No description

Parameters

Application $app
DatabaseManager $database
Repository $config

connectToTenant(TenantWithDatabase $tenant)

Connect to a tenant's database.

Parameters

TenantWithDatabase $tenant

reconnectToCentral()

Reconnect to the default non-tenant connection.

setDefaultConnection(string $connection)

Change the default database connection config.

Parameters

string $connection

createTenantConnection(TenantWithDatabase $tenant)

Create the tenant database connection.

Parameters

TenantWithDatabase $tenant

purgeTenantConnection()

Purge the tenant database connection.

void ensureTenantCanBeCreated(TenantWithDatabase $tenant)

Check if a tenant can be created.