mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 23:54:03 +00:00
31 lines
726 B
PHP
31 lines
726 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Contracts;
|
|
|
|
use Stancl\Tenancy\Tenant;
|
|
use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedException;
|
|
|
|
interface StorageDriver
|
|
{
|
|
public function createTenant(Tenant $tenant): bool; // todo return type
|
|
|
|
public function updateTenant(Tenant $tenant): bool; // todo return type
|
|
|
|
/**
|
|
* Find a tenant using an id.
|
|
*
|
|
* @param string $id
|
|
* @return Tenant
|
|
* @throws TenantCouldNotBeIdentifiedException
|
|
*/
|
|
public function findById(string $id): Tenant;
|
|
/**
|
|
* Find a tenant using a domain name.
|
|
*
|
|
* @param string $domain
|
|
* @return Tenant
|
|
*/
|
|
public function findByDomain(string $domain): Tenant;
|
|
}
|