1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 19:14:04 +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

@ -5,14 +5,14 @@ declare(strict_types=1);
namespace Stancl\Tenancy;
use ArrayAccess;
use Stancl\Tenancy\Contracts\Tenant as CurrentTenant;
// todo tenant storage
// todo create tenant - create db?
/**
* @internal Class is subject to breaking changes in minor and patch versions.
*/
class Tenant implements ArrayAccess, CurrentTenant
class Tenant implements ArrayAccess
{
use Traits\HasArrayAccess;
@ -85,7 +85,7 @@ class Tenant implements ArrayAccess, CurrentTenant
public function save(): self
{
if ($this->persisted) {
$this->manager->addTenant($this);
$this->manager->createTenant($this);
} else {
$this->manager->updateTenant($this);
}