// Load all of the configuration entities.
/** @var \Drupal\Core\Config\Config[] $configs */
$configs =
[];
$records =
[];
foreach ($this->configFactory->
loadMultiple($names) as $config) { $id =
$config->
get($this->idKey
);
$records[$id] =
$this->overrideFree ?
$config->
getOriginal(NULL, FALSE
) :
$config->
get();
$configs[$id] =
$config;
} $entities =
$this->
mapFromStorageRecords($records);
// Config entities wrap config objects, and therefore they need to inherit
// the cacheability metadata of config objects (to ensure e.g. additional
// cacheability metadata added by config overrides is not lost).
foreach ($entities as $id =>
$entity) { // But rather than simply inheriting all cacheability metadata of config
// objects, we need to make sure the self-referring cache tag that is
// present on Config objects is not added to the Config entity. It must be
// removed for 3 reasons:
// 1. When renaming/duplicating a Config entity, the cache tag of the
// original config object would remain present, which would be wrong.