mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 15:14:04 +00:00
34 lines
947 B
PHP
34 lines
947 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\ResourceSyncing;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Stancl\Tenancy\Contracts\Tenant;
|
|
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
|
|
|
|
// todo@move move all resource syncing-related things to a separate namespace?
|
|
|
|
/**
|
|
* @property-read Tenant[]|Collection $tenants
|
|
*/
|
|
interface SyncMaster extends Syncable
|
|
{
|
|
/**
|
|
* @return BelongsToMany<Tenant&Model, self&Model>
|
|
*/
|
|
public function tenants(): BelongsToMany;
|
|
|
|
public function getTenantModelName(): string;
|
|
|
|
public function triggerDetachEvent(TenantWithDatabase&Model $tenant): void;
|
|
|
|
public function triggerAttachEvent(TenantWithDatabase&Model $tenant): void;
|
|
|
|
public function triggerDeleteEvent(bool $forceDelete = false): void;
|
|
|
|
public function triggerRestoredEvent(): void;
|
|
}
|