diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php index 1624b2d..5541b87 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php @@ -9,6 +9,7 @@ use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Core\Controller\ControllerInterface; +use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\custom_block\CustomBlockTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -40,8 +41,11 @@ class CustomBlockController implements ControllerInterface { * {@inheritdoc} */ public static function create(ContainerInterface $container) { + $entity_manager = $container->get('plugin.manager.entity'); return new static( - $container->get('plugin.manager.entity') + $entity_manager->getStorageController('custom_block'), + $entity_manager->getStorageController('custom_block_type'), + $entity_manager ); } @@ -49,11 +53,15 @@ public static function create(ContainerInterface $container) { * Constructs a CustomBlock object. * * @param \Drupal\Component\Plugin\PluginManagerInterface $entity_manager + * The entity manager. + * @param \Drupal\Core\Entity\EntityStorageControllerInterface $custom_block_storage * The custom block storage controller. + * @param \Drupal\Core\Entity\EntityStorageControllerInterface $custom_block_type_storage + * The custom block type storage controller. */ - public function __construct(PluginManagerInterface $entity_manager) { - $this->customBlockStorage = $entity_manager->getStorageController('custom_block'); - $this->customBlockTypeStorage = $entity_manager->getStorageController('custom_block_type'); + public function __construct(PluginManagerInterface $entity_manager, EntityStorageControllerInterface $custom_block_storage, EntityStorageControllerInterface $custom_block_type_storage) { + $this->customBlockStorage = $custom_block_storage; + $this->customBlockTypeStorage = $custom_block_type_storage; $this->entityManager = $entity_manager; }