Methods |
public
static
|
isListOperation(SyncOperation::* $operation): ($operation is SyncOperation::*_LIST ? true : false)
Check if a sync operation is CREATE_LIST, READ_LIST, UPDATE_LIST or
DELETE_LIST
Check if a sync operation is CREATE_LIST, READ_LIST, UPDATE_LIST or
DELETE_LIST
|
#
|
public
static
|
isReadOperation(SyncOperation::* $operation): ($operation is SyncOperation::READ* ? true : false)
Check if a sync operation is READ or READ_LIST
Check if a sync operation is READ or READ_LIST
|
#
|
public
static
|
isWriteOperation(SyncOperation::* $operation): ($operation is SyncOperation::READ* ? false : true)
Check if a sync operation is CREATE, UPDATE, DELETE, CREATE_LIST,
UPDATE_LIST or DELETE_LIST
Check if a sync operation is CREATE, UPDATE, DELETE, CREATE_LIST,
UPDATE_LIST or DELETE_LIST
|
#
|
public
static
|
entityToProvider(
class-string<SyncEntityInterface> $entity,
?ContainerInterface $container = null,
): class-string<SyncProviderInterface>
Get the name of a sync entity's provider interface
Get the name of a sync entity's provider interface
|
#
|
public
static
|
providerToEntity(
class-string<SyncProviderInterface> $provider,
?ContainerInterface $container = null,
): array<class-string<SyncEntityInterface>>
Get the names of sync entities serviced by a provider interface
Get the names of sync entities serviced by a provider interface
|
#
|
public
static
|
getService<T is object>(ContainerInterface $container, class-string<T> $service): static<T>
Get an introspector for a service
Get an introspector for a service
Uses a container to resolve a service to a concrete class and returns an
introspector for it.
Overrides
|
#
|
public
static
|
get<T is object>(class-string<T> $class): static<T>
Get an introspector for a class
Get an introspector for a class
Overrides
|
#
|
protected
|
getIntrospectionClass(class-string<TClass> $class): SyncIntrospectionClass<TClass>
|
#
|
public
|
getSyncProviderInterfaces(): array<class-string<SyncProviderInterface>>
Get a list of SyncProviderInterface interfaces implemented by the
provider
Get a list of SyncProviderInterface interfaces implemented by the
provider
|
#
|
public
|
getSyncProviderEntities(): array<class-string<SyncEntityInterface>>
Get a list of SyncEntityInterface classes serviced by the provider
Get a list of SyncEntityInterface classes serviced by the provider
|
#
|
public
|
getSyncProviderEntityBasenames(): array<string, class-string<SyncEntityInterface>>
Get an array that maps unambiguous lowercase entity basenames to
SyncEntityInterface classes serviced by the provider
Get an array that maps unambiguous lowercase entity basenames to
SyncEntityInterface classes serviced by the provider
|
#
|
public
|
getCreateSyncEntityFromClosure(
bool $strict = false,
): Closure(mixed[], SyncProviderInterface, SyncContextInterface): TClass
Get a closure that creates SyncProviderInterface-serviced instances of the class
from arrays
Get a closure that creates SyncProviderInterface-serviced instances of the class
from arrays
Wraps {@see SyncIntrospector::getCreateSyncEntityFromSignatureClosure()}
in a closure that resolves array signatures to closures on-demand.
Parameters
$strict |
If true , the closure will throw an exception if it
receives any data that would be discarded.
|
|
#
|
public
|
getCreateSyncEntityFromSignatureClosure(
string[] $keys,
bool $strict = false,
): Closure(mixed[], SyncProviderInterface, SyncContextInterface): TClass
Get a closure that creates SyncProviderInterface-serviced instances of the class
from arrays with a given signature
Get a closure that creates SyncProviderInterface-serviced instances of the class
from arrays with a given signature
Parameters
$strict |
If true , throw an exception if any data would be
discarded.
|
|
#
|
public
|
getDeclaredSyncOperationClosure<T is SyncEntityInterface>(
SyncOperation::* $operation,
class-string<T>|static<T> $entity,
SyncProviderInterface $provider,
): (Closure(SyncContextInterface, mixed...): (iterable<T>|T))|null
Get the provider method that implements a sync operation for an entity
Get the provider method that implements a sync operation for an entity
Returns null if the provider doesn't implement the given operation via
a declared method, otherwise creates a closure for the operation and
binds it to $provider .
Throws
LogicException |
if the {@see SyncIntrospector} and $entity don't
respectively represent a {@see SyncProviderInterface} and
{@see SyncEntityInterface}.
|
|
#
|
public
|
getMagicSyncOperationClosure(string $method, SyncProviderInterface $provider): ?Closure
Get a closure to perform sync operations on behalf of a provider's
"magic" method
Get a closure to perform sync operations on behalf of a provider's
"magic" method
Returns null if:
- the {@see SyncIntrospector} was not created for a
{@see SyncProviderInterface},
- the {@see SyncProviderInterface} class already has
$method , or
-
$method doesn't resolve to an unambiguous sync operation on a
{@see SyncEntityInterface} class serviced by the
{@see SyncProviderInterface} class
|
#
|
protected
|
getKeyTargets(
array $keys,
bool $forNewInstance,
bool $strict,
bool $normalised = false,
array $customKeys = [],
array $keyClosures = [],
): IntrospectorKeyTargets
Get a list of actions required to apply values from an array to a new or
existing instance of the class
Get a list of actions required to apply values from an array to a new or
existing instance of the class
Parameters
$forNewInstance |
If true , keys are matched with constructor
parameters if possible.
|
$strict |
If true , an exception is thrown if any keys cannot
be applied to the class.
|
$normalised |
If true , the $keys array has already been
normalised.
|
$customKeys |
An array that maps key
types to keys as they appear in $keys .
|
$keyClosures |
Normalised key => closure
|
Overrides
|
#
|