1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-17 06:04:03 +00:00
tenancy/src/Contracts/Syncable.php
Abrar Ahmad 22d1b2065b
[4.x] Add feature to ignore the resource synchronization based on provided condition. (#993)
* wip

* add test

* readability

* remove group

* DisabledSync -> ConditionalSync; test both cases with dataset

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-11-04 15:04:29 +01:00

23 lines
651 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
interface Syncable
{
public function getGlobalIdentifierKeyName(): string;
public function getGlobalIdentifierKey(): string|int;
public function getCentralModelName(): string;
public function getSyncedAttributeNames(): array;
public function triggerSyncEvent(): void;
/** Get the attributes used for creating the *other* model (i.e. tenant if this is the central one, and central if this is the tenant one). */
public function getSyncedCreationAttributes(): array|null; // todo come up with a better name
public function shouldSync(): bool;
}