diff --git a/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php b/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php index 64f987b..164570d 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php @@ -7,12 +7,15 @@ namespace Drupal\field_ui; +use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Form\FormInterface; +use Drupal\Core\ControllerInterface; +use Drupal\Core\Entity\EntityManager; /** * Abstract base class for Field UI overview forms. */ -abstract class OverviewBase implements FormInterface { +abstract class OverviewBase implements FormInterface, ControllerInterface { /** * The name of the entity type. @@ -43,10 +46,36 @@ protected $adminPath = NULL; /** + * The entity manager. + * + * @var \Drupal\Core\Entity\EntityManager + */ + protected $entityManager; + + /** + * Constructs a new OverviewBase. + * + * @param \Drupal\Core\Entity\EntityManager $entity_manager + * The entity manager. + */ + public function __construct(EntityManager $entity_manager) { + $this->entityManager = $entity_manager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('plugin.manager.entity') + ); + } + + /** * {@inheritdoc} */ public function buildForm(array $form, array &$form_state, $entity_type = NULL, $bundle = NULL) { - $entity_info = entity_get_info($entity_type); + $entity_info = $this->entityManager->getDefinition($entity_type); if (!empty($entity_info['entity_bundle_prefix'])) { $bundle = $entity_info['entity_bundle_prefix'] . $bundle; }