1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-14 04:14:05 +00:00

Use a nicer way to bind the current tenant

This commit is contained in:
Samuel Štancl 2019-09-07 19:46:45 +02:00
parent 27425a4360
commit 6b716e5345
6 changed files with 62 additions and 38 deletions

View file

@ -4,26 +4,12 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
use Stancl\Tenancy\Tenant;
interface StorageDriver
{
public function identifyTenant(string $domain): array;
/** @return array[] */
public function getAllTenants(array $uuids = []): array;
public function getTenantById(string $uuid, array $fields = []): array;
public function getTenantIdByDomain(string $domain): ?string;
public function createTenant(string $domain, string $uuid): array;
public function deleteTenant(string $uuid): bool;
public function get(string $uuid, string $key);
public function getMany(string $uuid, array $keys): array;
public function put(string $uuid, string $key, $value);
public function putMany(string $uuid, array $values): array;
public function createTenant(Tenant $tenant): bool; // todo return type
public function updateTenant(Tenant $tenant): bool; // todo return type
public function findById(string $id): Tenant;
public function findByDomain(string $domain): Tenant;
}

View file

@ -1,10 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
/** Empty interface implemented by Stancl\Tenancy\Tenant have a dependency-injectable contract for the current tenant. */
interface Tenant
{
}