1
0
Fork 0
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:
Samuel Štancl 2026-04-12 13:29:28 +02:00 committed by GitHub
commit dc344b7ae6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 60 additions and 0 deletions

View file

@ -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
{