diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index f3f6962..f3b913c 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -54,7 +54,7 @@ public function __construct(ModuleHandlerInterface $module_handler) { /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler') ); diff --git a/core/lib/Drupal/Core/Entity/EntityNG.php b/core/lib/Drupal/Core/Entity/EntityNG.php index 62edbc7..1efd017 100644 --- a/core/lib/Drupal/Core/Entity/EntityNG.php +++ b/core/lib/Drupal/Core/Entity/EntityNG.php @@ -222,7 +222,7 @@ public function uuid() { public function uri($rel = 'canonical') { $entity_info = $this->entityInfo(); - $link_templates = isset($entity_info['links']) ? $entity_info['links'] : array(); + $link_templates = isset($entity_info->links) ? $entity_info->links : array(); if (isset($link_templates[$rel])) { $template = $link_templates[$rel]; @@ -823,7 +823,7 @@ public function label($langcode = NULL) { if (!isset($langcode)) { $langcode = $this->activeLangcode; } - if ($label_callback = $entity_info->getLabelCallback() && function_exists($label_callback)) { + if (($label_callback = $entity_info->getLabelCallback()) && function_exists($label_callback)) { $label = $label_callback($this->entityType, $this, $langcode); } elseif ($label_key = $entity_info->getKey('label')) { diff --git a/core/modules/action/lib/Drupal/action/ActionListController.php b/core/modules/action/lib/Drupal/action/ActionListController.php index 93b7be2..8a80d88 100644 --- a/core/modules/action/lib/Drupal/action/ActionListController.php +++ b/core/modules/action/lib/Drupal/action/ActionListController.php @@ -40,7 +40,7 @@ class ActionListController extends ConfigEntityListController implements EntityC * * @param string $entity_type * The entity type. - * @param array $entity_info + * @param \Drupal\Core\Entity\EntityType $entity_info * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The action storage controller. @@ -49,7 +49,7 @@ class ActionListController extends ConfigEntityListController implements EntityC * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ActionManager $action_manager, ModuleHandlerInterface $module_handler) { + public function __construct($entity_type, EntityType $entity_info, EntityStorageControllerInterface $storage, ActionManager $action_manager, ModuleHandlerInterface $module_handler) { parent::__construct($entity_type, $entity_info, $storage, $module_handler); $this->actionManager = $action_manager; diff --git a/core/modules/config/tests/config_test/config_test.module b/core/modules/config/tests/config_test/config_test.module index 41e7c62..e48cff5 100644 --- a/core/modules/config/tests/config_test/config_test.module +++ b/core/modules/config/tests/config_test/config_test.module @@ -88,13 +88,17 @@ function config_test_config_test_create(ConfigTest $config_test) { * Implements hook_entity_info_alter(). */ function config_test_entity_info_alter(&$entity_info) { + if (!isset($entity_info['config_test'])) { + return; + } + // The 'translatable' entity key is not supposed to change over time. In this // case we can safely do it because we set it once and we do not change it for // all the duration of the test session. - $entity_info['config_test']['translatable'] = Drupal::service('state')->get('config_test.translatable'); + $entity_info['config_test']->translatable = Drupal::service('state')->get('config_test.translatable'); // Create a clone of config_test that does not have a status. $entity_info['config_test_no_status'] = $entity_info['config_test']; - unset($entity_info['config_test_no_status']['entity_keys']['status']); - $entity_info['config_test_no_status']['config_prefix'] = 'config_test.no_status'; + unset($entity_info['config_test_no_status']->entity_keys['status']); + $entity_info['config_test_no_status']->config_prefix = 'config_test.no_status'; } diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 21811f4..18e456e 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -141,7 +141,7 @@ function entity_reference_field_settings_form($field, $instance) { // configuration entities from being referenced. if (!is_subclass_of($entity_info->getClass(), '\Drupal\Core\Config\Entity\ConfigEntityInterface')) { - $entity_type_options[$entity_type] = $entity_info['label']; + $entity_type_options[$entity_type] = $entity_info->getLabel(); } } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php index a1d7991..5c22acc 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Derivative/SelectionBase.php @@ -27,7 +27,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { foreach (entity_get_info() as $entity_type => $info) { if (!in_array($entity_type, $supported_entities)) { $this->derivatives[$entity_type] = $base_plugin_definition; - $this->derivatives[$entity_type]['label'] = t('@entity_type selection', array('@entity_type' => $info['label'])); + $this->derivatives[$entity_type]['label'] = t('@entity_type selection', array('@entity_type' => $info->getLabel())); } } return parent::getDerivativeDefinitions($base_plugin_definition); diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php index 9798a53..2b8dd38 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php @@ -164,8 +164,8 @@ protected function createNewEntity($label, $uid) { } $entity_info = $entity_manager->getDefinition($target_type); - $bundle_key = $entity_info['entity_keys']['bundle']; - $label_key = $entity_info['entity_keys']['label']; + $bundle_key = $entity_info->getKey('bundle'); + $label_key = $entity_info->getKey('label'); return $entity_manager->getStorageController($target_type)->create(array( $label_key => $label, diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc index 77cfd4b..c4201f3 100644 --- a/core/modules/field/field.attach.inc +++ b/core/modules/field/field.attach.inc @@ -960,7 +960,7 @@ function field_attach_delete(EntityInterface $entity) { } $entity_info = $entity->entityInfo(); - if ($entity_info->fieldsCachable()) { + if ($entity_info->fieldsCacheable()) { cache('field')->delete('field:' . $entity->entityType() . ':' . $entity->id()); } } diff --git a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php index 8e43b47..4bac2ba 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php @@ -741,7 +741,7 @@ public function hasData() { foreach ($this->getBundles() as $entity_type => $bundle) { // Entity Query throws an exception if there is no base table. $entity_info = \Drupal::entityManager()->getDefinition($entity_type); - if (!isset($entity_info['base_table'])) { + if (!$entity_info->hasBaseTable()) { continue; } $query = $factory->get($entity_type); diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc index a958c5b..3dfa25c 100644 --- a/core/modules/field/tests/modules/field_test/field_test.entity.inc +++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc @@ -57,7 +57,7 @@ function field_test_entity_bundle_info() { $entity_info = entity_get_info(); foreach ($entity_info as $entity_type => $info) { - if ($info['module'] == 'field_test') { + if ($info->getModule() == 'field_test') { $bundles[$entity_type] = Drupal::state()->get('field_test_bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); } } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php index cd3d640..ccfc722 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php @@ -10,6 +10,7 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityManager; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\field\FieldInfo; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -52,7 +53,7 @@ class FieldListController extends ConfigEntityListController { * * @param string $entity_type * The type of entity to be listed. - * @param array $entity_info + * @param \Drupal\Core\Entity\EntityType $entity_info * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityManager $entity_manager * The entity manager. @@ -61,7 +62,7 @@ class FieldListController extends ConfigEntityListController { * @param \Drupal\field\FieldInfo $field_info * The field info service. */ - public function __construct($entity_type, array $entity_info, EntityManager $entity_manager, ModuleHandlerInterface $module_handler, FieldInfo $field_info) { + public function __construct($entity_type, EntityType $entity_info, EntityManager $entity_manager, ModuleHandlerInterface $module_handler, FieldInfo $field_info) { parent::__construct($entity_type, $entity_info, $entity_manager->getStorageController($entity_type), $module_handler); $this->fieldTypes = field_info_field_types(); @@ -73,7 +74,7 @@ public function __construct($entity_type, array $entity_info, EntityManager $ent /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php index 98495d5..f9faad4 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php @@ -10,6 +10,7 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityFormController; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -52,7 +53,7 @@ public function __construct(ModuleHandlerInterface $module_handler, ConfigFactor /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler'), $container->get('config.factory'), diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php index c8df5e6..b8adde9 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php @@ -12,6 +12,7 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -33,7 +34,7 @@ class FilterFormatListController extends ConfigEntityListController implements F * * @param string $entity_type * The type of entity to be listed. - * @param array $entity_info + * @param \Drupal\Core\Entity\EntityType $entity_info * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The entity storage controller class. @@ -42,7 +43,7 @@ class FilterFormatListController extends ConfigEntityListController implements F * @param \Drupal\Core\Config\ConfigFactory $config_factory * The config factory. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, ConfigFactory $config_factory) { + public function __construct($entity_type, EntityType $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, ConfigFactory $config_factory) { parent::__construct($entity_type, $entity_info, $storage, $module_handler); $this->configFactory = $config_factory; @@ -51,7 +52,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php index 8eb4458..d47d699 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php @@ -9,6 +9,7 @@ use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityFormController; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Language\Language; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Path\AliasManagerInterface; @@ -45,10 +46,14 @@ class MenuLinkFormController extends EntityFormController implements EntityContr /** * Constructs a new MenuLinkFormController object. * - * @param \Drupal\Core\Extension\ModuleHandlerInterface + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler service. + * @param MenuLinkStorageControllerInterface $menu_link_storage_controller + * The menu link storage. * @param \Drupal\Core\Path\AliasManagerInterface $path_alias_manager * The path alias manager. + * @param \Drupal\Core\Routing\UrlGenerator $url_generator + * The URL generator. */ public function __construct(ModuleHandlerInterface $module_handler, MenuLinkStorageControllerInterface $menu_link_storage_controller, AliasManagerInterface $path_alias_manager, UrlGenerator $url_generator) { parent::__construct($module_handler); @@ -60,7 +65,7 @@ public function __construct(ModuleHandlerInterface $module_handler, MenuLinkStor /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info, $operation = NULL) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController('menu_link'), diff --git a/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php b/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php index 5a3fdb0..14f4203 100644 --- a/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php +++ b/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php @@ -10,6 +10,7 @@ use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityNGConfirmFormBase; use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Routing\PathBasedGeneratorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -54,7 +55,7 @@ public function __construct(ModuleHandlerInterface $module_handler, PathBasedGen /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler'), $container->get('url_generator'), diff --git a/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php b/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php index d159b3d..a44508e 100644 --- a/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php +++ b/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php @@ -9,6 +9,7 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Database\Connection; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -42,7 +43,7 @@ public function __construct(ModuleHandlerInterface $module_handler, Connection $ /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler'), $container->get('database') diff --git a/core/modules/node/lib/Drupal/node/NodeTypeListController.php b/core/modules/node/lib/Drupal/node/NodeTypeListController.php index d6be67d..db59b6b 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeListController.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeListController.php @@ -8,6 +8,7 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityType; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -33,7 +34,7 @@ class NodeTypeListController extends ConfigEntityListController implements Entit * * @param string $entity_type * The type of entity to be listed. - * @param array $entity_info + * @param \Drupal\Core\Entity\EntityType $entity_info * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The entity storage controller class. @@ -42,14 +43,14 @@ class NodeTypeListController extends ConfigEntityListController implements Entit * @param \Drupal\Core\Routing\PathBasedGeneratorInterface $url_generator * The url generator service. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, PathBasedGeneratorInterface $url_generator) { + public function __construct($entity_type, EntityType $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, PathBasedGeneratorInterface $url_generator) { parent::__construct($entity_type, $entity_info, $storage, $module_handler); $this->urlGenerator = $url_generator; } /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/node/tests/modules/node_test/node_test.module b/core/modules/node/tests/modules/node_test/node_test.module index 12e0eed..84dde36 100644 --- a/core/modules/node/tests/modules/node_test/node_test.module +++ b/core/modules/node/tests/modules/node_test/node_test.module @@ -185,7 +185,7 @@ function node_test_node_insert(EntityInterface $node) { * Implements hook_entity_info_alter(). */ function node_test_entity_info_alter(&$entity_info) { - if (Drupal::state()->get('node_test.storage_controller')) { - $entity_info['node']['class'] = 'Drupal\node_test\NodeTest'; + if (isset($entity_info['node']) && Drupal::state()->get('node_test.storage_controller')) { + $entity_info['node']->setClass('Drupal\node_test\NodeTest'); } } diff --git a/core/modules/system/lib/Drupal/system/DateFormatListController.php b/core/modules/system/lib/Drupal/system/DateFormatListController.php index e08c825..8776540 100644 --- a/core/modules/system/lib/Drupal/system/DateFormatListController.php +++ b/core/modules/system/lib/Drupal/system/DateFormatListController.php @@ -12,6 +12,7 @@ use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -32,7 +33,7 @@ class DateFormatListController extends ConfigEntityListController { * * @param string $entity_type * The type of entity to be listed. - * @param array $entity_info + * @param \Drupal\Core\Entity\EntityType $entity_info * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The entity storage controller class. @@ -41,7 +42,7 @@ class DateFormatListController extends ConfigEntityListController { * @param \Drupal\Core\Datetime\Date $date_service * The date service. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, Date $date_service) { + public function __construct($entity_type, EntityType $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, Date $date_service) { parent::__construct($entity_type, $entity_info, $storage, $module_handler); $this->dateService = $date_service; @@ -50,7 +51,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php b/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php index 3d3dfc7..24c077c 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php @@ -11,6 +11,7 @@ use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -43,7 +44,7 @@ public function __construct(ModuleHandlerInterface $module_handler, Date $date_s /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler'), $container->get('date') diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php index 4d347c5..b335ee9 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php @@ -11,6 +11,7 @@ use Drupal\Core\Ajax\ReplaceCommand; use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Datetime\DrupalDateTime; @@ -66,7 +67,7 @@ function __construct(ModuleHandlerInterface $module_handler, QueryFactory $query /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler'), $container->get('entity.query'), diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php index 1dbb859..8765a5e 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php @@ -50,7 +50,7 @@ public function form(array $form, array &$form_state) { // @todo: Is there a better way to check if an entity type is revisionable? $entity_info = $entity->entityInfo(); - if (!empty($entity_info['entity_keys']['revision']) && !$entity->isNew()) { + if ($entity_info->getKey('revision') && !$entity->isNew()) { $form['revision'] = array( '#type' => 'checkbox', '#title' => t('Create new revision'), diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php index 332b322..bd31ca0 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php @@ -93,7 +93,7 @@ protected function init() { */ public function label($langcode = Language::LANGCODE_DEFAULT) { $info = $this->entityInfo(); - if (isset($info['entity_keys']['label']) && $info['entity_keys']['label'] == 'name') { + if ($info->getKey('label') == 'name') { return $this->getTranslation($langcode)->name->value; } else { diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php index 4ad9376..a277b5f 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php @@ -8,6 +8,7 @@ namespace Drupal\views_ui; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\views\Plugin\views\wizard\WizardPluginBase; use Drupal\views\Plugin\views\wizard\WizardException; @@ -43,7 +44,7 @@ public function __construct(ModuleHandlerInterface $module_handler, ViewsPluginM /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.views.wizard') diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 015a855..523f329 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -10,6 +10,7 @@ use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\HtmlCommand; use Drupal\Core\Ajax\ReplaceCommand; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Component\Utility\NestedArray; use Drupal\views\ViewExecutable; @@ -57,7 +58,7 @@ public function __construct(ModuleHandlerInterface $module_handler, TempStoreFac /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info, $operation = NULL) { return new static( $container->get('module_handler'), $container->get('user.tempstore'), diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php index 4ac5b8c..fc76297 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php @@ -8,6 +8,7 @@ namespace Drupal\views_ui; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\user\TempStoreFactory; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -41,7 +42,7 @@ public function __construct(ModuleHandlerInterface $module_handler, TempStoreFac /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('module_handler'), $container->get('user.tempstore')