You are here

protected function ConfigEntityAdapter::getTypedConfigManager in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\ConfigEntityAdapter::getTypedConfigManager()

Gets the typed config manager.

Return value

\Drupal\Core\Config\TypedConfigManagerInterface The typed config manager.

File

core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php, line 85

Class

ConfigEntityAdapter
Enhances EntityAdapter for config entities.

Namespace

Drupal\Core\Entity\Plugin\DataType

Code

protected function getTypedConfigManager() {
  if (empty($this->typedConfigManager)) {

    // Use the typed data manager if it is also the typed config manager.
    // @todo Remove this in https://www.drupal.org/node/3011137.
    $typed_data_manager = $this
      ->getTypedDataManager();
    if ($typed_data_manager instanceof TypedConfigManagerInterface) {
      $this->typedConfigManager = $typed_data_manager;
    }
    else {
      $this->typedConfigManager = \Drupal::service('config.typed');
    }
  }
  return $this->typedConfigManager;
}