Skip to content

CacheService

github-actions[bot] edited this page Jun 27, 2023 · 11 revisions

CommonGateway\CoreBundle\Service\CacheService

Service to call external sources.

This service provides a guzzle wrapper to work with sources in the common gateway.

Methods

Name Description
__construct
cacheEndpoint Put a single endpoint into the cache.
cacheObject Put a single object into the cache.
cacheShema Put a single schema into the cache.
cleanup Remove non-existing items from the cache.
getEndpoint Get a single endpoint from the cache.
getEndpoints
getObject Get a single object from the cache.
getSchema Get a single schema from the cache.
handleResultPagination Adds pagination variables to an array with the results we found with searchObjects().
removeEndpoint Removes an endpoint from the cache.
removeObject Removes an object from the cache.
removeSchema Removes an Schema from the cache.
retrieveObjectsFromCache Retrieves objects from a cache collection.
searchObjects Searches the object store for objects containing the search string.
setPagination Decides the pagination values.
setStyle Set symfony style in order to output to the console.
warmup Throws all available objects into the cache.

CacheService::__construct

Description

 __construct (void)

Parameters

This function has no parameters.

Return Values

void


CacheService::cacheEndpoint

Description

public cacheEndpoint (\Endpoint $endpoint)

Put a single endpoint into the cache.

Parameters

  • (\Endpoint) $endpoint

Return Values

\Endpoint


CacheService::cacheObject

Description

public cacheObject (\ObjectEntity $objectEntity)

Put a single object into the cache.

Parameters

  • (\ObjectEntity) $objectEntity

Return Values

\ObjectEntity


CacheService::cacheShema

Description

public cacheShema (\Entity $entity)

Put a single schema into the cache.

Parameters

  • (\Entity) $entity

Return Values

\Entity


CacheService::cleanup

Description

public cleanup (void)

Remove non-existing items from the cache.

Parameters

This function has no parameters.

Return Values

void


CacheService::getEndpoint

Description

public getEndpoint (\Uuid $identification)

Get a single endpoint from the cache.

Parameters

  • (\Uuid) $identification

Return Values

array|null


CacheService::getEndpoints

Description

 getEndpoints (void)

Parameters

This function has no parameters.

Return Values

void


CacheService::getObject

Description

public getObject (string $identification)

Get a single object from the cache.

Parameters

  • (string) $identification

Return Values

array|null


CacheService::getSchema

Description

public getSchema (\Uuid $identification)

Get a single schema from the cache.

Parameters

  • (\Uuid) $identification

Return Values

array|null


CacheService::handleResultPagination

Description

public handleResultPagination (array $filter, array $results, int $total)

Adds pagination variables to an array with the results we found with searchObjects().

Parameters

  • (array) $filter
  • (array) $results
  • (int) $total

Return Values

array

the result with pagination.


CacheService::removeEndpoint

Description

public removeEndpoint (\Endpoint $endpoint)

Removes an endpoint from the cache.

Parameters

  • (\Endpoint) $endpoint

Return Values

void


CacheService::removeObject

Description

public removeObject (\ObjectEntity $objectEntity)

Removes an object from the cache.

Parameters

  • (\ObjectEntity) $objectEntity

Return Values

void


CacheService::removeSchema

Description

public removeSchema (\Entity $entity)

Removes an Schema from the cache.

Parameters

  • (\Entity) $entity

Return Values

void


CacheService::retrieveObjectsFromCache

Description

public retrieveObjectsFromCache (array $filter, array $options, array $completeFilter)

Retrieves objects from a cache collection.

Parameters

  • (array) $filter
  • (array) $options
  • (array) $completeFilter

Return Values

array|null

$this->handleResultPagination()


CacheService::searchObjects

Description

public searchObjects (string|null $search, array $filter, array $entities)

Searches the object store for objects containing the search string.

Parameters

  • (string|null) $search : a string to search for within the given context
  • (array) $filter : an array of dot.notation filters for wich to search with
  • (array) $entities : schemas to limit te search to

Return Values

array|null

Throws Exceptions

\Exception


CacheService::setPagination

Description

public setPagination (int $limit, int $start, array $filters)

Decides the pagination values.

Parameters

  • (int) $limit : The resulting limit
  • (int) $start : The resulting start value
  • (array) $filters : The filters

Return Values

array


CacheService::setStyle

Description

public setStyle (\SymfonyStyle $style)

Set symfony style in order to output to the console.

Parameters

  • (\SymfonyStyle) $style

Return Values

self


CacheService::warmup

Description

public warmup (void)

Throws all available objects into the cache.

Parameters

This function has no parameters.

Return Values

void


Clone this wiki locally