1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 23:54:03 +00:00

general refactor, move more classes under Database namespace

This commit is contained in:
Samuel Štancl 2022-08-27 03:17:16 +02:00
parent 2d7e9dfd89
commit 40bf28c7d0
41 changed files with 122 additions and 133 deletions

View file

@ -1,21 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
use Stancl\Tenancy\DatabaseConfig;
// todo possibly move to Database namespace, along with other classes
interface ManagesDatabaseUsers extends TenantDatabaseManager
{
/** Create a database user. */
public function createUser(DatabaseConfig $databaseConfig): bool;
/** Delete a database user. */
public function deleteUser(DatabaseConfig $databaseConfig): bool;
/** Does a database user exist? */
public function userExists(string $username): bool;
}

View file

@ -1,29 +0,0 @@
<?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;
/** Construct 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;
}

View file

@ -1,15 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
use Stancl\Tenancy\DatabaseConfig;
interface TenantWithDatabase extends Tenant
{
public function database(): DatabaseConfig;
/** Get an internal key. */
public function getInternal(string $key): mixed;
}