mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-07 04:34:04 +00:00
Merge branch 'master' into broadcasting-fixes
This commit is contained in:
commit
dc344b7ae6
2 changed files with 60 additions and 0 deletions
|
|
@ -152,6 +152,26 @@ class Tenancy
|
|||
$this->initialized = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* End tenancy and initialize it again for the current tenant.
|
||||
*
|
||||
* This can be helpful when changing "dependencies" of bootstrappers such as
|
||||
* attributes of the current tenant that are only read once, during bootstrap().
|
||||
*
|
||||
* If tenancy is not initialized, this method is a no-op.
|
||||
*/
|
||||
public function reinitialize(): void
|
||||
{
|
||||
if ($this->tenant === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$tenant = $this->tenant;
|
||||
$this->end();
|
||||
|
||||
$this->initialize($tenant);
|
||||
}
|
||||
|
||||
/** @return TenancyBootstrapper[] */
|
||||
public function getBootstrappers(): array
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue