<TEntity is SyncEntityInterface, TProvider is HttpSyncProvider>
final | |
---|---|
extends |
AbstractSyncDefinition<TEntity, TProvider> |
implements |
Buildable<HttpSyncDefinitionBuilder<TEntity, TProvider>> |
uses |
HasBuilder, HasMutator |
Generates closures that use an HttpSyncProvider to perform sync operations on an entity
Override {@see HttpSyncProvider::buildHttpDefinition()} to service HTTP endpoints declaratively via {@see HttpSyncDefinition} objects.
If more than one implementation of a sync operation is available for an entity, the order of precedence is as follows:
Provider::getFaculties()
or Provider::createUser()
If no implementations are found, {@see SyncOperationNotImplementedException} is thrown.
Type aliases | ||
---|---|---|
OverrideClosure
|
(Closure(static, SyncOperation::*, SyncContextInterface, int|string|null, mixed...): TEntity)|(Closure(static, SyncOperation::*, SyncContextInterface, mixed...): iterable<TEntity>)|(Closure(static, SyncOperation::*, SyncContextInterface, TEntity, mixed...): TEntity)|(Closure(static, SyncOperation::*, SyncContextInterface, iterable<TEntity>, mixed...): iterable<TEntity>)
|
# |
Methods | ||
---|---|---|
public
|
withPath(string[]|string|null $path): static
|
# |
public
|
withQuery(mixed[]|null $query): static
|
# |
public
|
withHeaders(?HttpHeadersInterface $headers): static
|
# |
public
|
withPager(?CurlerPagerInterface $pager, bool $alwaysPaginate = false): static
|
# |
public
|
withExpiry(int<-1, max>|null $expiry): static
|
# |
public
|
withMethodMap(array<SyncOperation::*, HttpRequestMethod::*> $methodMap): static
|
# |
public
|
withCurlerCallback(
(callable(CurlerInterface, HttpSyncDefinition<TEntity, TProvider>, SyncOperation::*, SyncContextInterface, mixed...): CurlerInterface)|null $callback,
): static
|
# |
public
|
withArgs(mixed[]|null $args): static
|
# |
protected
|
getClosure(int $operation): ?Closure
|
# |
public
static
|
getReadableProperties(): array
|
# |
Methods used from Salient\Core\Concern\HasChainableMethods |
---|
apply(), if(), withEach() |
Methods used from Salient\Core\Concern\HasBuilder |
---|
getBuilder(), build(), resolve() |
Constants | ||
---|---|---|
public
|
DEFAULT_METHOD_MAP = [
SyncOperation::CREATE => HttpRequestMethod::POST,
SyncOperation::READ => HttpRequestMethod::GET,
SyncOperation::UPDATE => HttpRequestMethod::PUT,
SyncOperation::DELETE => HttpRequestMethod::DELETE,
SyncOperation::CREATE_LIST => HttpRequestMethod::POST,
SyncOperation::READ_LIST => HttpRequestMethod::GET,
SyncOperation::UPDATE_LIST => HttpRequestMethod::PUT,
SyncOperation::DELETE_LIST => HttpRequestMethod::DELETE,
]
|
# |
Properties | |||
---|---|---|---|
public
readonly
|
string[]|string|null
|
$Path
|
# |
public
readonly
|
mixed[]|null
|
$Query
|
# |
public
readonly
|
HttpHeadersInterface|null
|
$Headers
|
# |
public
readonly
|
CurlerPagerInterface|null
|
$Pager
|
# |
public
readonly
|
bool
|
$AlwaysPaginate
|
# |
public
readonly
|
int<-1, max>|null
|
$Expiry
|
# |
public
readonly
|
array<SyncOperation::*, HttpRequestMethod::*>
|
$MethodMap
|
# |
public
readonly
|
(callable(CurlerInterface, HttpSyncDefinition<TEntity, TProvider>, SyncOperation::*, SyncContextInterface, mixed...): CurlerInterface)|null
|
$CurlerCallback
|
# |
public
readonly
|
bool
|
$SyncOneEntityPerRequest
|
# |
public
readonly
|
(callable(HttpSyncDefinition<TEntity, TProvider>, SyncOperation::*, SyncContextInterface, mixed...): HttpSyncDefinition<TEntity, TProvider>)|null
|
$Callback
|
# |
public
readonly
|
mixed[]|null
|
$Args
|
# |