Methods |
public
|
__construct(
ContainerInterface $container,
TProvider $provider,
class-string<TEntity> $entity,
?SyncContextInterface $context = null,
)
|
#
|
public
|
getProvider(): SyncProviderInterface
Get the object's provider
Get the object's provider
Implements
|
#
|
public
|
entity(): string
Get the sync entity being serviced
Get the sync entity being serviced
Implements
|
#
|
public
|
run(int $operation, ...$args)
|
#
|
public
|
create($entity, ...$args): SyncEntityInterface
Add an entity to the backend
Add an entity to the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::CREATE} operation, e.g. one of the following for a
Faculty entity:
<?php
// 1.
public function createFaculty(SyncContextInterface $ctx, Faculty $entity): Faculty;
// 2.
public function create_Faculty(SyncContextInterface $ctx, Faculty $entity): Faculty;
The first parameter after SyncContextInterface $ctx :
- must be defined
- must have a native type declaration, which must be the class of the
entity being created
- must be required
Implements
|
#
|
public
|
get(int|string|null $id, ...$args): SyncEntityInterface
Get an entity from the backend
Get an entity from the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::READ} operation, e.g. one of the following for a
Faculty entity:
<?php
// 1.
public function getFaculty(SyncContextInterface $ctx, $id): Faculty;
// 2.
public function get_Faculty(SyncContextInterface $ctx, $id): Faculty;
The first parameter after SyncContextInterface $ctx :
- must be defined
- must not have a native type declaration, but may be tagged as an
int|string|null parameter for static analysis purposes
- must be nullable
Implements
|
#
|
public
|
update($entity, ...$args): SyncEntityInterface
Update an entity in the backend
Update an entity in the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::UPDATE} operation, e.g. one of the following for a
Faculty entity:
<?php
// 1.
public function updateFaculty(SyncContextInterface $ctx, Faculty $entity): Faculty;
// 2.
public function update_Faculty(SyncContextInterface $ctx, Faculty $entity): Faculty;
The first parameter after SyncContextInterface $ctx :
- must be defined
- must have a native type declaration, which must be the class of the
entity being updated
- must be required
Implements
|
#
|
public
|
delete($entity, ...$args): SyncEntityInterface
Delete an entity from the backend
Delete an entity from the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::DELETE} operation, e.g. one of the following for a
Faculty entity:
<?php
// 1.
public function deleteFaculty(SyncContextInterface $ctx, Faculty $entity): Faculty;
// 2.
public function delete_Faculty(SyncContextInterface $ctx, Faculty $entity): Faculty;
The first parameter after SyncContextInterface $ctx :
- must be defined
- must have a native type declaration, which must be the class of the
entity being deleted
- must be required
The return value:
- must represent the final state of the entity before it was deleted
Implements
|
#
|
public
|
createList(iterable<TEntity> $entities, ...$args): FluentIteratorInterface<array-key, TEntity>
Add a list of entities to the backend
Add a list of entities to the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::CREATE_LIST} operation, e.g. one of the following
for a Faculty entity:
<?php
// 1. With a plural entity name
public function createFaculties(SyncContextInterface $ctx, iterable $entities): iterable;
// 2. With a singular name
public function createList_Faculty(SyncContextInterface $ctx, iterable $entities): iterable;
The first parameter after SyncContextInterface $ctx :
- must be defined
- must have a native type declaration, which must be
iterable
- must be required
Implements
|
#
|
public
|
getList(...$args): FluentIteratorInterface<array-key, TEntity>
Get a list of entities from the backend
Get a list of entities from the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::READ_LIST} operation, e.g. one of the following for
a Faculty entity:
<?php
// 1. With a plural entity name
public function getFaculties(SyncContextInterface $ctx): iterable;
// 2. With a singular name
public function getList_Faculty(SyncContextInterface $ctx): iterable;
Implements
|
#
|
public
|
updateList(iterable<TEntity> $entities, ...$args): FluentIteratorInterface<array-key, TEntity>
Update a list of entities in the backend
Update a list of entities in the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::UPDATE_LIST} operation, e.g. one of the following
for a Faculty entity:
<?php
// 1. With a plural entity name
public function updateFaculties(SyncContextInterface $ctx, iterable $entities): iterable;
// 2. With a singular name
public function updateList_Faculty(SyncContextInterface $ctx, iterable $entities): iterable;
The first parameter after SyncContextInterface $ctx :
- must be defined
- must have a native type declaration, which must be
iterable
- must be required
Implements
|
#
|
public
|
deleteList(iterable<TEntity> $entities, ...$args): FluentIteratorInterface<array-key, TEntity>
Delete a list of entities from the backend
Delete a list of entities from the backend
The underlying {@see SyncProviderInterface} must implement the
{@see SyncOperation::DELETE_LIST} operation, e.g. one of the following
for a Faculty entity:
<?php
// 1. With a plural entity name
public function deleteFaculties(SyncContextInterface $ctx, iterable $entities): iterable;
// 2. With a singular name
public function deleteList_Faculty(SyncContextInterface $ctx, iterable $entities): iterable;
The first parameter after SyncContextInterface $ctx :
- must be defined
- must have a native type declaration, which must be
iterable
- must be required
The return value:
- must represent the final state of the entities before they were deleted
Implements
|
#
|
public
|
runA(int $operation, ...$args): array
|
#
|
public
|
createListA(iterable $entities, ...$args): array
Add a list of entities to the backend and return an array
Add a list of entities to the backend and return an array
Implements
|
#
|
public
|
getListA(...$args): array
Get a list of entities from the backend as an array
Get a list of entities from the backend as an array
Implements
|
#
|
public
|
updateListA(iterable $entities, ...$args): array
Update a list of entities in the backend and return an array
Update a list of entities in the backend and return an array
Implements
|
#
|
public
|
deleteListA(iterable $entities, ...$args): array
Delete a list of entities from the backend and return an array
Delete a list of entities from the backend and return an array
Implements
|
#
|
public
|
online()
Perform sync operations on the backend directly, ignoring any entities in
the entity store
Perform sync operations on the backend directly, ignoring any entities in
the entity store
Implements
|
#
|
public
|
offline()
Perform "get" operations on the entity store, throwing an exception if
entities have never been synced with the backend
Perform "get" operations on the entity store, throwing an exception if
entities have never been synced with the backend
Implements
|
#
|
public
|
offlineFirst()
Retrieve entities directly from the backend unless it cannot be reached
or the entity store's copies are sufficiently…
Retrieve entities directly from the backend unless it cannot be reached
or the entity store's copies are sufficiently fresh
Implements
|
#
|
public
|
doNotResolve()
Do not resolve deferred entities or relationships
Do not resolve deferred entities or relationships
Implements
|
#
|
public
|
resolveEarly()
Resolve deferred entities and relationships immediately
Resolve deferred entities and relationships immediately
Implements
|
#
|
public
|
resolveLate()
Resolve deferred entities and relationships after reaching the end of
each stream of entity data
Resolve deferred entities and relationships after reaching the end of
each stream of entity data
Implements
|
#
|
public
|
doNotHydrate()
Do not hydrate entities returned by the backend
Do not hydrate entities returned by the backend
Implements
|
#
|
public
|
hydrate(int $policy = HydrationPolicy::EAGER, ?string $entity = null, $depth = null)
Apply the given hydration policy to entities returned by the backend
Apply the given hydration policy to entities returned by the backend
Implements
|
#
|
public
|
getResolver(
?string $nameProperty = null,
int $algorithm = TextComparisonAlgorithm::SAME,
$uncertaintyThreshold = null,
?string $weightProperty = null,
bool $requireOneMatch = false,
): SyncEntityResolverInterface
Use a property of the entity class to resolve names to entities
Use a property of the entity class to resolve names to entities
Parameters
$weightProperty |
If multiple entities are equally
similar to a given name, the one with the highest weight is preferred.
|
Implements
|
#
|