class Manager

The synchronization Manager can be used to sync a Space to this server.

It provides notifications about added, updated and deleted assets and entries.

Methods

__construct(Client $client, ResourceBuilder $builder, bool $preview)

Manager constructor.

sync(string|null $token = null, Query $query = null)

No description

startSync(Query $query = null)

Starts a new Synchronization.

continueSync(string|Result $token)

Continues the synchronization either at the next page, or with the results since the initial synchronization.

Details

at line 50
__construct(Client $client, ResourceBuilder $builder, bool $preview)

Manager constructor.

Do not instantiate this class yourself, use Contentful\Delivery\Client::getSynchronizationManager() instead.

Parameters

Client $client
ResourceBuilder $builder
bool $preview

See also

\Contentful\Delivery\Client::getSynchronizationManager()

at line 63
Generator sync(string|null $token = null, Query $query = null)

Parameters

string|null $token
Query $query

Return Value

Generator An instance of Result wrapped in a Generator object

at line 86
Result startSync(Query $query = null)

Starts a new Synchronization.

The result will contain all the resources currently present in the space. By calling Result::isDone(), it can be checked if there's another page of results, if so call continueSync to get the next page.

A Query object can be used to return only a subset of the space.

Parameters

Query $query

Return Value

Result

at line 104
Result continueSync(string|Result $token)

Continues the synchronization either at the next page, or with the results since the initial synchronization.

Parameters

string|Result $token

Return Value

Result

Exceptions

RuntimeException if this method is used for a subsequent sync when used with the Preview API