class ResourcePool extends Extended

deprecated 4.1 Use Contentful\Delivery\ResourcePool\Extended instead

ResourcePool class.

This class acts as a registry for current objects managed by the Client. It also abstracts access to objects stored in cache.

Properties

protected string $api from Standard
protected string $spaceId from Standard
protected string $environmentId from Standard
protected JsonDecoderClientInterface $client from Extended
protected CacheItemPoolInterface $cacheItemPool from Extended
protected string[] $warmupTypes from Extended
protected bool[] $warmupStack When retrieving from cache, there's the risk of an endless loop, so we keep track of the resources we're currently warming up, and skip the process if we track that we're already in the process of doing so. from Extended
protected bool $autoWarmup from Extended

Methods

__construct(JsonDecoderClientInterface $client, CacheItemPoolInterface $cacheItemPool, bool $autoWarmup = false, bool $cacheContent = false)

Simple constructor.

from Extended
savesResource(string $type)

Determines whether the given resource type must be actually stored.

from Extended
string|null
getResourceLocale(ResourceInterface $resource)

No description

from Standard
warmUp(string $key, string $type)

Skeleton method which a can be overridden.

from Extended
has(string $type, string $id, array $options = [])

{@inheritdoc}

from Standard
save(ResourceInterface $resource)

{@inheritdoc}

from Extended
get(string $type, string $id, array $options = [])

{@inheritdoc}

from Standard
generateKey(string $type, string $id, array $options = [])

{@inheritdoc}

from Standard

Details

in Extended at line 60
__construct(JsonDecoderClientInterface $client, CacheItemPoolInterface $cacheItemPool, bool $autoWarmup = false, bool $cacheContent = false)

Simple constructor.

Parameters

JsonDecoderClientInterface $client
CacheItemPoolInterface $cacheItemPool
bool $autoWarmup
bool $cacheContent

in Extended at line 84
protected savesResource(string $type)

Determines whether the given resource type must be actually stored.

Parameters

string $type

in Standard at line 63
protected string|null getResourceLocale(ResourceInterface $resource)

Parameters

ResourceInterface $resource

Return Value

string|null

in Extended at line 92
protected warmUp(string $key, string $type)

Skeleton method which a can be overridden.

Parameters

string $key
string $type

in Standard at line 82
has(string $type, string $id, array $options = [])

{@inheritdoc}

Parameters

string $type
string $id
array $options

in Extended at line 114
save(ResourceInterface $resource)

{@inheritdoc}

Parameters

ResourceInterface $resource

in Standard at line 118
get(string $type, string $id, array $options = [])

{@inheritdoc}

Parameters

string $type
string $id
array $options

in Standard at line 134
generateKey(string $type, string $id, array $options = [])

{@inheritdoc}

Parameters

string $type
string $id
array $options