You are here

protected function ContentEntityStorageTrait::setStaticCache in Multiversion 8

File

src/Entity/Storage/ContentEntityStorageTrait.php, line 557

Class

ContentEntityStorageTrait

Namespace

Drupal\multiversion\Entity\Storage

Code

protected function setStaticCache(array $entities) {
  if (version_compare(\Drupal::VERSION, '8.7', '>')) {
    parent::setStaticCache($entities);
  }
  else {
    if ($this->entityType
      ->isStaticallyCacheable()) {
      $ws = $this
        ->getWorkspaceId();
      if (!isset($this->entities[$ws])) {
        $this->entities[$ws] = [];
      }
      $this->entities[$ws] += $entities;
    }
  }
}