entityTypeManager = $entity_type_manager; } /** * {@inheritdoc} */ protected function resolveCacheMiss($key) { $ids = $this->entityTypeManager->getStorage('block_content')->getQuery() ->condition('uuid', $key) ->execute(); // Only cache if there is a match, otherwise creating new entities would // require to invalidate the cache. $id = reset($ids); if ($id) { $this->storage[$key] = $id; $this->persist($key); } return $id; } }