You are here

protected function EdgeEntityStorageBase::setPersistentCache in Apigee Edge 8

Stores entities in the persistent cache backend.

Parameters

\Drupal\Core\Entity\EntityInterface[] $entities: Entities to store in the cache.

3 calls to EdgeEntityStorageBase::setPersistentCache()
AppStorage::setPersistentCache in src/Entity/Storage/AppStorage.php
Stores entities in the persistent cache backend.
DeveloperStorage::setPersistentCache in src/Entity/Storage/DeveloperStorage.php
Stores entities in the persistent cache backend.
EdgeEntityStorageBase::processLoadedEntities in src/Entity/Storage/EdgeEntityStorageBase.php
Processes loaded (SDK) entities to Drupal entities.
2 methods override EdgeEntityStorageBase::setPersistentCache()
AppStorage::setPersistentCache in src/Entity/Storage/AppStorage.php
Stores entities in the persistent cache backend.
DeveloperStorage::setPersistentCache in src/Entity/Storage/DeveloperStorage.php
Stores entities in the persistent cache backend.

File

src/Entity/Storage/EdgeEntityStorageBase.php, line 390

Class

EdgeEntityStorageBase
Base entity storage class for Apigee Edge entities.

Namespace

Drupal\apigee_edge\Entity\Storage

Code

protected function setPersistentCache(array $entities) {
  if (!$this->entityType
    ->isPersistentlyCacheable()) {
    return;
  }
  foreach ($entities as $id => $entity) {
    $this->cacheBackend
      ->set($this
      ->buildCacheId($id), $entity, $this
      ->getPersistentCacheExpiration(), $this
      ->getPersistentCacheTags($entity));
  }
}