diff --git a/core/modules/image/lib/Drupal/image/ImageStyleAddFormController.php b/core/modules/image/lib/Drupal/image/ImageStyleAddFormController.php index fafe749..289add9 100644 --- a/core/modules/image/lib/Drupal/image/ImageStyleAddFormController.php +++ b/core/modules/image/lib/Drupal/image/ImageStyleAddFormController.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityFormController; -use Drupal\Core\Entity\EntityManager; +use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\StringTranslation\Translator\TranslatorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -20,11 +20,11 @@ class ImageStyleAddFormController extends EntityFormController implements EntityControllerInterface { /** - * The entity manager service. + * The storage controller. * - * @var \Drupal\Core\Entity\EntityManager + * @var \Drupal\Core\Entity\EntityStorageControllerInterface */ - protected $entityManager; + protected $storageController; /** * The translator service. @@ -38,14 +38,14 @@ class ImageStyleAddFormController extends EntityFormController implements Entity * * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler service. - * @param \Drupal\image\ImageEffectManager $image_effect_manager - * The image effect manager service. + * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller + * The storage controller. * @param \Drupal\Core\StringTranslation\Translator\TranslatorInterface $translator * The translator service. */ - public function __construct(ModuleHandlerInterface $module_handler, EntityManager $entity_manager, TranslatorInterface $translator) { + public function __construct(ModuleHandlerInterface $module_handler, EntityStorageControllerInterface $storage_controller, TranslatorInterface $translator) { $this->moduleHandler = $module_handler; - $this->entityManager = $entity_manager; + $this->storageController = $storage_controller; $this->translator = $translator; parent::__construct($this->moduleHandler); } @@ -56,7 +56,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityManage public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), - $container->get('plugin.manager.entity'), + $container->get('plugin.manager.entity')->getStorageController($entity_type), $container->get('string_translation') ); } @@ -66,7 +66,6 @@ public static function createInstance(ContainerInterface $container, $entity_typ */ public function form(array $form, array &$form_state) { $form = parent::form($form, $form_state); - $storage_controller = $this->entityManager->getStorageController('image_style'); $form['label'] = array( '#type' => 'textfield', @@ -78,7 +77,7 @@ public function form(array $form, array &$form_state) { $form['name'] = array( '#type' => 'machine_name', '#machine_name' => array( - 'exists' => array($storage_controller, 'load'), + 'exists' => array($this->storageController, 'load'), ), '#default_value' => $this->entity->id(), '#required' => TRUE,