mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-15 04:04:03 +00:00
* install PHP CS Fixer * Fix styling * remove StyleCI config * use config from archtechx/template * Fix styling * added `php-cs-fixer` * Update .php-cs-fixer.php * added GitHub token * Update ci.yml * Update ci.yml * Update ci.yml * php-cs-fixer workflow same as template Co-authored-by: Erik Gaal <me@erikgaal.nl> Co-authored-by: erikgaal <erikgaal@users.noreply.github.com>
37 lines
846 B
PHP
37 lines
846 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Contracts;
|
|
|
|
use Stancl\Tenancy\Exceptions\NoConnectionSetException;
|
|
|
|
interface TenantDatabaseManager
|
|
{
|
|
/**
|
|
* Create a database.
|
|
*/
|
|
public function createDatabase(TenantWithDatabase $tenant): bool;
|
|
|
|
/**
|
|
* Delete a database.
|
|
*/
|
|
public function deleteDatabase(TenantWithDatabase $tenant): bool;
|
|
|
|
/**
|
|
* Does a database exist.
|
|
*/
|
|
public function databaseExists(string $name): bool;
|
|
|
|
/**
|
|
* Make a DB connection config array.
|
|
*/
|
|
public function makeConnectionConfig(array $baseConfig, string $databaseName): array;
|
|
|
|
/**
|
|
* Set the DB connection that should be used by the tenant database manager.
|
|
*
|
|
* @throws NoConnectionSetException
|
|
*/
|
|
public function setConnection(string $connection): void;
|
|
}
|