Plentymarkets interface documentation

CacheBlocks

Contracts

CacheTagRepositoryContract

Add tags to content cache entries for tag based invalidation.

Namespace

Plenty\Modules\ContentCache\CacheBlocks\Contracts

Methods
public makeTaggable($variableName, $factory, $dataType = ""):void

Watch for accesses on a global twig variable and add all related cache tags on use.

Parameters

Name

Type

Description

$variableName

string

$factory

callable

$dataType

string

Eloquent model representing a Content Cache Link.

Namespace

Plenty\Modules\ContentCache\ContentCacheLink\Models

Properties
Name Type Description

id

int

plentyId

int

linkType

string

cacheKey

string

linkId

int

Methods
public toArray()

Returns this model as an array.

ContentCache

ContentCacheSettings

ContentCacheSettings

Eloquent model representing the Content Cache Settings.

Namespace

Plenty\Modules\ContentCache\ContentCacheSettings

Properties
Name Type Description

plentyId

int

contentCacheActive

bool

version

int

Methods
public toArray()

Returns this model as an array.

Contracts

ContentCacheInvalidationRepositoryContract

Interface for content cache invalidation

Namespace

Plenty\Modules\ContentCache\Contracts

Methods
public invalidateByManufacturerId($manufacturerId, $plentyId = null, $delaySeconds):void

Soft purge all cache entries related to given manufacturer ID.

Parameters

Name

Type

Description

$manufacturerId

int

$plentyId

int

$delaySeconds

int

public invalidateVariationIds($variationIds, $plentyId = null, $delaySeconds, $invalidateParent = false):void

Completely remove all cache entries related to given variation IDs.

Parameters

Name

Type

Description

$variationIds

array

IDs of the variation to invalidate cache entries for

$plentyId

int

$delaySeconds

int

$invalidateParent

bool

public invalidateItemIds($itemIds, $plentyId = null, $delaySeconds):void

Invalidate cache entries for specified item IDs.

Parameters

Name

Type

Description

$itemIds

array

$plentyId

int

$delaySeconds

int

public invalidateAll($plentyId = null, $bypassActiveCheck = false):void

Invalidate all cache entries related to given plenty ID.

Parameters

Name

Type

Description

$plentyId

int

$bypassActiveCheck

bool

public invalidateUri($uri):void

Invalidate cache entries by URI.

Parameters

Name

Type

Description

$uri

string

public storeInvalidationStacks():void

Store all collected invalidation entries in the database.

ContentCacheQueryParamsRepositoryContract

Interface for registering request query parameters which should be handled by the content cache

Namespace

Plenty\Modules\ContentCache\Contracts

Methods
public registerExcluded($queryParams):void

Register an array of query parameters to be excluded from the content cache.

Parameters

Name

Type

Description

$queryParams

array

public registerIncluded($queryParams):void

Register an array of query params to be considered when determining the requested cache entry.

Parameters

Name

Type

Description

$queryParams

array

public getRegistered($key = ""):array
Parameters

Name

Type

Description

$key

string

'included' or 'excluded'

ContentCacheRepositoryContract

Save and retrieve values to or from the content cache

Namespace

Plenty\Modules\ContentCache\Contracts

Methods
public enableCacheForResponse($options = []):void

Enable content caching for response so next request on this resource will be delivered from content cache.

Parameters

Name

Type

Description

$options

array

Additional options to be considered when handling cache entries. Possible options are: - enableQueryParams: boolean Set to true to enable caching pages having query params.

public disableCacheForResponse($reason = "", $disableLog = false):void

Disable caching for current response because of any unwanted behavior.

Parameters

Name

Type

Description

$reason

string

Reason why the response is not cached.

$disableLog

bool

Option to disable log entries.

public linkVariationsToResponse($variationIds):void

Link variations to current response.

Parameters

Name

Type

Description

$variationIds

array

Ids of variations referenced by the current response.

ContentCacheSettingsRepositoryContract

Interface for content cache settings

Namespace

Plenty\Modules\ContentCache\Contracts

Methods
public getSettings($plentyId):Plenty\Modules\ContentCache\ContentCacheSettings\ContentCacheSettings
Return type: ContentCacheSettings

Get the content cache settings for the specified client.

Parameters

Name

Type

Description

$plentyId

int

The plenty id of the client.

public getSettingsMultiple($plentyIds):void

Get the content cache settings for multiple clients.

Parameters

Name

Type

Description

$plentyIds

array

The plenty ids of the clients.

public saveSettings($plentyId, $contentCacheActive):Plenty\Modules\ContentCache\ContentCacheSettings\ContentCacheSettings
Return type: ContentCacheSettings

Save the content cache settings for the specified client.

Parameters

Name

Type

Description

$plentyId

int

The plenty id of the client.

$contentCacheActive

bool

Flag that indicates the content cache active state.

public getInvalidationDate($plentyId):string

Get the date until when the content cache invalidation is deactivated.

Parameters

Name

Type

Description

$plentyId

int

The plenty id of the client.

public saveInvalidationDate($plentyId, $invalidationDate):void

Save the date until when the content cache invalidation is deactivated.

Parameters

Name

Type

Description

$plentyId

int

The plenty id of the client.

$invalidationDate

string

The date until when the invalidation is deactivated.

public isInvalidationActive($plentyId):bool

Check if the content cache invalidation is currently active.

Parameters

Name

Type

Description

$plentyId

int

The plenty id of the client.

public getInstantInvalidationCount($plentyId):int
Parameters

Name

Type

Description

$plentyId

int

The plenty id of the client.

public invalidateInstantly($plentyId):void
Parameters

Name

Type

Description

$plentyId

int

The plenty id of the client.