mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-16 01:04:03 +00:00
[4.x] Only revert initialized bootstrappers (#1385)
* Only revert initialized bootstrappers (Tenancy::initializedBootstrappers) * Fix use of @property across the codebase
This commit is contained in:
parent
f308e2f84d
commit
8f8af34c32
5 changed files with 110 additions and 4 deletions
|
|
@ -35,6 +35,20 @@ class Tenancy
|
|||
*/
|
||||
public static array $findWith = [];
|
||||
|
||||
/**
|
||||
* A list of bootstrappers that have been initialized.
|
||||
*
|
||||
* This is used when reverting tenancy, mainly if an exception
|
||||
* occurs during bootstrapping, to ensure we don't revert
|
||||
* bootstrappers that haven't been properly initialized
|
||||
* (bootstrapped for the first time) previously.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @var list<class-string<TenancyBootstrapper>>
|
||||
*/
|
||||
public array $initializedBootstrappers = [];
|
||||
|
||||
/** Initialize tenancy for the passed tenant. */
|
||||
public function initialize(Tenant|int|string $tenant): void
|
||||
{
|
||||
|
|
@ -192,7 +206,6 @@ class Tenancy
|
|||
|
||||
/**
|
||||
* Run a callback for multiple tenants.
|
||||
* More performant than running $tenant->run() one by one.
|
||||
*
|
||||
* @param array<Tenant>|array<string|int>|\Traversable|string|int|null $tenants
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue