mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:24:03 +00:00
24 lines
682 B
PHP
24 lines
682 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Database\Contracts;
|
|
|
|
use Illuminate\Database\Connection;
|
|
use Stancl\Tenancy\Database\Exceptions\NoConnectionSetException;
|
|
|
|
/**
|
|
* Tenant database manager with a persistent connection.
|
|
*/
|
|
interface StatefulTenantDatabaseManager extends TenantDatabaseManager
|
|
{
|
|
/** Get the DB connection used by the tenant database manager. */
|
|
public function database(): Connection; // todo@dbRefactor rename to connection()
|
|
|
|
/**
|
|
* Set the DB connection that should be used by the tenant database manager.
|
|
*
|
|
* @throws NoConnectionSetException
|
|
*/
|
|
public function setConnection(string $connection): void;
|
|
}
|