Methods |
public
static
|
getDefaultProvider(ContainerInterface $container): SyncProviderInterface
Get the entity's default provider
Get the entity's default provider
Implemented by
|
#
|
public
static
|
withDefaultProvider(
ContainerInterface $container,
?SyncContextInterface $context = null,
): SyncEntityProviderInterface<static>
Perform sync operations on the entity using its default provider
Perform sync operations on the entity using its default provider
Implemented by
|
#
|
public
static
|
getSerializeRules(): SyncSerializeRulesInterface<static>
Get the entity's serialization rules
Get the entity's serialization rules
Implemented by
|
#
|
public
static
|
getPlural(): ?string
Get the plural form of the entity's short name
Get the plural form of the entity's short name
If this method returns a value other than null or the unqualified name
of the entity, it may be used to identify provider methods that implement
sync operations on the entity.
For example, if Faculty::getPlural() returns null , a provider may
implement Faculty sync operations via one or more of the following:
-
create_faculty()
-
get_faculty()
-
update_faculty()
-
delete_faculty()
-
createList_faculty()
-
getList_faculty()
-
updateList_faculty()
-
deleteList_faculty()
If the same method returns "Faculties" , these are also recognised as
Faculty sync implementations:
-
createFaculty()
-
getFaculty()
-
updateFaculty()
-
deleteFaculty()
-
createFaculties()
-
getFaculties()
-
updateFaculties()
-
deleteFaculties()
Implemented by
|
#
|
public
|
getId()
Get the unique identifier assigned to the entity by its provider
Get the unique identifier assigned to the entity by its provider
|
#
|
public
|
getCanonicalId(): int|string|null
Get the unique identifier assigned to the entity by its canonical backend
Get the unique identifier assigned to the entity by its canonical backend
If a provider is bound to the service container as the default
implementation of the entity's underlying provider interface, it is
regarded as its canonical backend.
To improve the accuracy and performance of sync operations, providers
should propagate this value to and from backends capable of storing it.
Implemented by
|
#
|
public
|
getName(): string
Get the name of the entity
Get the name of the entity
|
#
|
public
static
|
idFromNameOrId(
int|string|null $nameOrId,
SyncProviderInterface|SyncContextInterface $providerOrContext,
?float $uncertaintyThreshold = null,
?string $nameProperty = null,
?float &$uncertainty = null,
): int|string|null
Resolve a name or entity ID to the entity ID of one matching entity
Resolve a name or entity ID to the entity ID of one matching entity
Returns:
-
null if $nameOrId is null
-
$nameOrId if it is a valid identifier for the entity in the given
provider (see {@see SyncProviderInterface::isValidIdentifier()}), or
- the entity ID of the entity to which
$nameOrId resolves
A {@see SyncEntityNotFoundExceptionInterface} is thrown if:
- there are no matching entities, or
- there are multiple matching entities
Implemented by
|
#
|
public
|
toArray(?SyncStoreInterface $store = null): array<string, mixed>
Serialize the entity and any nested entities
Serialize the entity and any nested entities
Rules returned by {@see SyncEntityInterface::getSerializeRules()} are
used.
Implemented by
|
#
|
public
|
toArrayWith(SyncSerializeRulesInterface<static> $rules, ?SyncStoreInterface $store = null): array<string, mixed>
Use the given serialization rules to serialize the entity and any nested
entities
Use the given serialization rules to serialize the entity and any nested
entities
Implemented by
|
#
|
public
|
toLink(
?SyncStoreInterface $store = null,
LinkType::* $type = LinkType::DEFAULT,
bool $compact = true,
): array<string, int|string>
Get the entity's canonical location in the form of an array
Get the entity's canonical location in the form of an array
Inspired by JSON-LD.
Implemented by
|
#
|
public
|
getUri(?SyncStoreInterface $store = null, bool $compact = true): string
Get the entity's canonical location in the form of a URI
Get the entity's canonical location in the form of a URI
Inspired by OData.
Implemented by
|
#
|