mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 16:44:04 +00:00
Add DatabaseCacheBootstrapper docblock
This commit is contained in:
parent
d482bb9e2d
commit
52052c807a
1 changed files with 11 additions and 0 deletions
|
|
@ -9,6 +9,17 @@ use Illuminate\Config\Repository;
|
||||||
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
||||||
use Stancl\Tenancy\Contracts\Tenant;
|
use Stancl\Tenancy\Contracts\Tenant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This bootstrapper allows cache to be stored in the tenant databases by switching the database cache store's connection.
|
||||||
|
* Intended to be used with the 'database' cache store, instead of CacheTenancyBootstrapper.
|
||||||
|
*
|
||||||
|
* On bootstrap(), the database cache store's connection is set to 'tenant'
|
||||||
|
* and the database cache store is purged from the CacheManager's resolved stores.
|
||||||
|
* This forces the manager to resolve a new instance of the database store created with the 'tenant' DB connection on the next cache operation.
|
||||||
|
*
|
||||||
|
* On revert, the cache store's connection is reverted to the originally used one (usually 'central'), and again,
|
||||||
|
* the database cache store is purged from the CacheManager's resolved stores so that the originally used one is resolved on the next cache operation.
|
||||||
|
*/
|
||||||
class DatabaseCacheBootstrapper implements TenancyBootstrapper
|
class DatabaseCacheBootstrapper implements TenancyBootstrapper
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue