Methods |
abstract
protected
|
getDbConnector(): DbConnector
Specify how to connect to the backend
Specify how to connect to the backend
The {@see DbConnector} returned will be cached for the lifetime of the
{@see DbSyncProvider} instance.
|
#
|
public
|
getBackendIdentifier(): array
Get a stable list of values that, together with its class name, uniquely
identifies the provider's backend instance
Get a stable list of values that, together with its class name, uniquely
identifies the provider's backend instance
This method must be idempotent for each backend instance the provider
connects to. The return value should correspond to the smallest possible
set of stable metadata that uniquely identifies the specific data source
backing the connected instance.
This may include:
- an endpoint URI (if backend instances are URI-specific or can be
expressed as an immutable URI)
- a tenant ID
- an installation GUID
It should not include:
- usernames, API keys, tokens, or other identifiers with a shorter
lifespan than the data source itself
- values that aren't unique to the connected data source
- case-insensitive values (unless normalised first)
It must not include:
- values retrieved from a provider at runtime
Implements
|
#
|
final
public
|
getDefinition(string $entity): SyncDefinitionInterface
Get the provider's implementation of sync operations for an entity
Get the provider's implementation of sync operations for an entity
Implements
|
#
|
protected
|
getDbDefinition<TEntity is SyncEntityInterface>(class-string<TEntity> $entity): DbSyncDefinition<TEntity, $this>
Override to implement sync operations by returning a DbSyncDefinition
object for the given entity
Override to implement sync operations by returning a DbSyncDefinition
object for the given entity
|
#
|
final
protected
|
builderFor<TEntity is SyncEntityInterface>(class-string<TEntity> $entity): DbSyncDefinitionBuilder<TEntity, $this>
Get a new DbSyncDefinitionBuilder for an entity
Get a new DbSyncDefinitionBuilder for an entity
|
#
|
final
public
|
dbConnector(): DbConnector
Get a DbConnector instance to open connections to the backend
Get a DbConnector instance to open connections to the backend
|
#
|
final
public
|
getDb(): ADOConnection
Get a connection to the backend
Get a connection to the backend
|
#
|
protected
|
getSqlQuery(ADOConnection $db): SqlQuery
Get a SqlQuery instance to prepare queries for the backend
Get a SqlQuery instance to prepare queries for the backend
|
#
|
public
|
checkHeartbeat(int $ttl = 300)
Throw an exception if the backend isn't reachable
Throw an exception if the backend isn't reachable
Positive results should be cached for $ttl seconds. Negative results
must never be cached.
Overrides
Implements
|
#
|
protected
|
first(
array<array<string, mixed>> $rows,
class-string<SyncEntityInterface> $entity,
int|string $id,
): array<string, mixed>
Get the first row in a recordset, or throw a SyncEntityNotFoundException
Get the first row in a recordset, or throw a SyncEntityNotFoundException
Parameters
$rows |
The recordset retrieved from the
backend.
|
$entity |
The requested entity.
|
$id |
The identifier of the requested entity.
|
|
#
|