1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 21:54:03 +00:00
This commit is contained in:
Samuel Štancl 2019-09-06 18:52:04 +02:00
commit 5d2b1e3a72
5 changed files with 15 additions and 6 deletions

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts; namespace Stancl\Tenancy\Contracts;
use Stancl\Tenancy\Tenant; use Stancl\Tenancy\Tenant;
@ -7,5 +9,6 @@ use Stancl\Tenancy\Tenant;
interface TenancyBootstrapper interface TenancyBootstrapper
{ {
public function start(Tenant $tenant); // todo better name? public function start(Tenant $tenant); // todo better name?
public function end(Tenant $tenant); // todo arg? public function end(Tenant $tenant); // todo arg?
} }

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Stancl\Tenancy; namespace Stancl\Tenancy;
use Illuminate\Database\DatabaseManager as BaseDatabaseManager; use Illuminate\Database\DatabaseManager as BaseDatabaseManager;
@ -48,4 +50,4 @@ class DatabaseManagerv2
$this->database->reconnect($connection); $this->database->reconnect($connection);
$this->database->setDefaultConnection($connection); $this->database->setDefaultConnection($connection);
} }
} }

View file

@ -1,10 +1,12 @@
<?php <?php
declare(strict_types=1);
namespace Stancl\Tenancy\TenancyBoostrappers; namespace Stancl\Tenancy\TenancyBoostrappers;
use Stancl\Tenancy\DatabaseManager;
use Illuminate\Foundation\Application; use Illuminate\Foundation\Application;
use Stancl\Tenancy\Contracts\TenancyBootstrapper; use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\DatabaseManager;
class DatabaseTenancyBootstrapper implements TenancyBootstrapper class DatabaseTenancyBootstrapper implements TenancyBootstrapper
{ {
@ -29,4 +31,4 @@ class DatabaseTenancyBootstrapper implements TenancyBootstrapper
{ {
$this->database->reconnect(); $this->database->reconnect();
} }
} }

View file

@ -48,7 +48,7 @@ class TenantManagerv2
{ {
$this->bootstrapTenancy($tenant); $this->bootstrapTenancy($tenant);
$this->setTenant($tenant); $this->setTenant($tenant);
return $this; return $this;
} }

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Stancl\Tenancy\Traits; namespace Stancl\Tenancy\Traits;
trait HasArrayAccess trait HasArrayAccess
@ -23,4 +25,4 @@ trait HasArrayAccess
{ {
unset($this->$offset); unset($this->$offset);
} }
} }