Methods |
public
|
getContext(): ?SyncContextInterface
Get the context within which the provider is servicing the entity
Get the context within which the provider is servicing the entity
Implemented by
|
#
|
public
|
toLink(LinkType::* $type = LinkType::DEFAULT, bool $compact = true): array<string, int|string>
Get the deferred entity's canonical location in the form of an array
Get the deferred entity's canonical location in the form of an array
Implemented by
|
#
|
public
|
getUri(bool $compact = true): string
Get the deferred entity's canonical location in the form of a URI
Get the deferred entity's canonical location in the form of a URI
Implemented by
|
#
|
public
|
resolve(): TEntity
Resolve the deferred entity from the provider or the local entity store
Resolve the deferred entity from the provider or the local entity store
This method returns the resolved entity without taking further action.
{@see DeferredEntityInterface::replace()} is called separately.
Implemented by
|
#
|
public
|
replace(TEntity $entity): void
Resolve the deferred entity with an instance
Resolve the deferred entity with an instance
If $callback was given when the entity was deferred, it is called with
the given entity, otherwise the variable or property given via $replace
is replaced.
Subsequent calls to {@see DeferredEntityInterface::resolve()} return the
same instance.
Throws
Implemented by
|
#
|
public
static
|
defer(
SyncProviderInterface $provider,
SyncContextInterface|null $context,
class-string<TEntity> $entity,
int|string $entityId,
TEntity|static|null &$replace = null,
(Closure(TEntity): void)|null $callback = null,
): void
Defer retrieval of a sync entity
Defer retrieval of a sync entity
Parameters
$provider |
The provider servicing the entity.
|
$context |
The context within which the
provider is servicing the entity.
|
$entity |
The entity to instantiate.
|
$entityId |
The identifier of the deferred entity.
|
$replace |
Refers to the variable or property to
replace when the entity is resolved.
|
$callback |
If given, $replace is
ignored and the resolved entity is passed to the callback.
|
Implemented by
|
#
|
public
static
|
deferList(
SyncProviderInterface $provider,
SyncContextInterface|null $context,
class-string<TEntity> $entity,
array<int|string> $entityIds,
array<TEntity|static>|null &$replace = null,
(Closure(TEntity): void)|null $callback = null,
): void
Defer retrieval of a list of sync entities
Defer retrieval of a list of sync entities
Parameters
$provider |
The provider servicing the entity.
|
$context |
The context within which the
provider is servicing the entity.
|
$entity |
The entity to instantiate.
|
$entityIds |
A list of deferred entity
identifiers.
|
$replace |
Refers to the variable or
property to replace when the entities are resolved.
|
$callback |
If given, $replace is
ignored and each resolved entity is passed to the callback.
|
Implemented by
|
#
|