You are here

private function EntityManagerWrapper::getStorageDecorator in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Entity/EntityManagerWrapper.php \Drupal\webprofiler\Entity\EntityManagerWrapper::getStorageDecorator()
  2. 8 webprofiler/src/Entity/EntityManagerWrapper.php \Drupal\webprofiler\Entity\EntityManagerWrapper::getStorageDecorator()
  3. 8.2 webprofiler/src/Entity/EntityManagerWrapper.php \Drupal\webprofiler\Entity\EntityManagerWrapper::getStorageDecorator()

Parameters

$entity_type:

$handler:

Return value

\Drupal\webprofiler\Entity\EntityDecorator

1 call to EntityManagerWrapper::getStorageDecorator()
EntityManagerWrapper::getStorage in webprofiler/src/Entity/EntityManagerWrapper.php
Creates a new storage instance.

File

webprofiler/src/Entity/EntityManagerWrapper.php, line 91

Class

EntityManagerWrapper
Class EntityManagerWrapper.

Namespace

Drupal\webprofiler\Entity

Code

private function getStorageDecorator($entity_type, $handler) {
  if ($handler instanceof ConfigEntityStorageInterface) {
    switch ($entity_type) {

      // Do not need a 'break' statement after each case-breaking 'return'.
      case 'taxonomy_vocabulary':
        return new VocabularyStorageDecorator($handler);
      case 'user_role':
        return new RoleStorageDecorator($handler);
      case 'shortcut_set':
        return new ShortcutSetStorageDecorator($handler);
      case 'image_style':
        return new ImageStyleStorageDecorator($handler);
      case 'domain':
        return new DomainStorageDecorator($handler);
      default:
        return new ConfigEntityStorageDecorator($handler);
    }
  }
  return $handler;
}