diff -u b/core/includes/entity.inc b/core/includes/entity.inc --- b/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -13,7 +13,7 @@ * Clears the entity render cache for all entity types. */ function entity_render_cache_clear() { - $entity_manager = Drupal::entityTypeManager(); + $entity_manager = Drupal::entityManager(); foreach ($entity_manager->getDefinitions() as $entity_type => $info) { if ($entity_manager->hasHandler($entity_type, 'view_builder')) { $entity_manager->getViewBuilder($entity_type)->resetCache(); @@ -32,19 +32,19 @@ * The bundle info for a specific entity type, or all entity types. * * @deprecated in Drupal 8.x-dev and will be removed before Drupal 9.0.0. Use - * \Drupal\Core\Entity\EntityManagerInterface::getBundleInfo() for a single - * bundle, or \Drupal\Core\Entity\EntityManagerInterface::getAllBundleInfo() + * \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() for a single + * bundle, or \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() * for all bundles. * - * @see \Drupal\Core\Entity\EntityManagerInterface::getBundleInfo() - * @see \Drupal\Core\Entity\EntityManagerInterface::getAllBundleInfo() + * @see \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() + * @see \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() */ function entity_get_bundles($entity_type = NULL) { if (isset($entity_type)) { - return \Drupal\Core\Entity\EntityManagerInterface::getBundleInfo($entity_type); + return \Drupal::entityManager()->getBundleInfo($entity_type); } else { - return \Drupal\Core\Entity\EntityManagerInterface::getAllBundleInfo(); + return \Drupal::entityManager()->getAllBundleInfo(); } } @@ -71,13 +71,13 @@ * @endcode * * @see \Drupal\Core\Entity\EntityInterface::load() - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::load() * @see \Drupal\Core\Entity\Sql\SqlContentEntityStorage * @see \Drupal\Core\Entity\Query\QueryInterface */ function entity_load($entity_type, $id, $reset = FALSE) { - $controller = \Drupal::entityTypeManager()->getStorage($entity_type); + $controller = \Drupal::entityManager()->getStorage($entity_type); if ($reset) { $controller->resetCache(array($id)); } @@ -103,12 +103,12 @@ * \Drupal::entityTypeManager()->getStorage($entity_type)->loadRevision($revision_id); * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::loadRevision() * @see \Drupal\Core\Entity\Sql\SqlContentEntityStorage */ function entity_revision_load($entity_type, $revision_id) { - return \Drupal::entityTypeManager() + return \Drupal::entityManager() ->getStorage($entity_type) ->loadRevision($revision_id); } @@ -128,11 +128,11 @@ * \Drupal::entityTypeManager()->getStorage($entity_type)>deleteRevision($revision_id); * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::deleteRevision() */ function entity_revision_delete($entity_type, $revision_id) { - \Drupal::entityTypeManager() + \Drupal::entityManager() ->getStorage($entity_type) ->deleteRevision($revision_id); } @@ -175,13 +175,13 @@ * @endcode * * @see \Drupal\Core\Entity\EntityInterface::loadMultiple() - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::loadMultiple() * @see \Drupal\Core\Entity\Sql\SqlContentEntityStorage * @see \Drupal\Core\Entity\Query\QueryInterface */ function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) { - $controller = \Drupal::entityTypeManager()->getStorage($entity_type); + $controller = \Drupal::entityManager()->getStorage($entity_type); if ($reset) { $controller->resetCache($ids); } @@ -208,11 +208,11 @@ * \Drupal::entityTypeManager()->getStorage($entity_type)->loadByProperties($values); * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::loadByProperties() */ function entity_load_multiple_by_properties($entity_type, array $values) { - return \Drupal::entityTypeManager() + return \Drupal::entityManager() ->getStorage($entity_type) ->loadByProperties($values); } @@ -239,11 +239,11 @@ * \Drupal::entityTypeManager()->getStorage($entity_type)->loadUnchanged($id). * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::loadUnchanged() */ function entity_load_unchanged($entity_type, $id) { - return \Drupal::entityTypeManager() + return \Drupal::entityManager() ->getStorage($entity_type) ->loadUnchanged($id); } @@ -264,12 +264,12 @@ * $storage_handler->delete($entities); * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::loadMultiple() * @see \Drupal\Core\Entity\EntityStorageInterface::delete() */ function entity_delete_multiple($entity_type, array $ids) { - $controller = \Drupal::entityTypeManager()->getStorage($entity_type); + $controller = \Drupal::entityManager()->getStorage($entity_type); $entities = $controller->loadMultiple($ids); $controller->delete($entities); } @@ -295,11 +295,11 @@ * \Drupal::entityTypeManager()->getStorage($entity_type)->create($values) * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() * @see \Drupal\Core\Entity\EntityStorageInterface::create() */ function entity_create($entity_type, array $values = array()) { - return \Drupal::entityTypeManager() + return \Drupal::entityManager() ->getStorage($entity_type) ->create($values); } @@ -353,11 +353,11 @@ * return $view_builder->view($entity, $view_mode, $langcode); * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getViewBuilder() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getViewBuilder() * @see \Drupal\Core\Entity\EntityViewBuilderInterface::view() */ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $reset = FALSE) { - $render_controller = \Drupal::entityTypeManager()->getViewBuilder($entity->getEntityTypeId()); + $render_controller = \Drupal::entityManager()->getViewBuilder($entity->getEntityTypeId()); if ($reset) { $render_controller->resetCache([$entity]); } @@ -390,11 +390,11 @@ * return $view_builder->viewMultiple($entities, $view_mode, $langcode); * @endcode * - * @see \Drupal\Core\Entity\EntityManagerInterface::getViewBuilder() + * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getViewBuilder() * @see \Drupal\Core\Entity\EntityViewBuilderInterface::viewMultiple() */ function entity_view_multiple(array $entities, $view_mode, $langcode = NULL, $reset = FALSE) { - $render_controller = \Drupal::entityTypeManager()->getViewBuilder(reset($entities)->getEntityTypeId()); + $render_controller = \Drupal::entityManager()->getViewBuilder(reset($entities)->getEntityTypeId()); if ($reset) { $render_controller->resetCache($entities); } @@ -443,7 +443,7 @@ * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. * If the display is available in configuration use: * @code - * \Drupal::entityManager()->getStorage('entity_view_display')->load($entity_type . '.' . $bundle . '.' . $view_mode); + * \Drupal::entityTypeManager()->getStorage('entity_view_display')->load($entity_type . '.' . $bundle . '.' . $view_mode); * @endcode * When the display is not available in configuration, you can create a new * EntityViewDisplay object using: @@ -454,7 +454,7 @@ * 'mode' => $view_mode, * 'status' => TRUE, * )); - * \Drupal::entityManager()->getStorage('entity_view_display')->create($values); + * \Drupal::entityTypeManager()->getStorage('entity_view_display')->create($values); * @endcode * * @see \Drupal\Core\Entity\EntityStorageInterface::create() @@ -519,7 +519,7 @@ * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. * If the entity form display is available in configuration use: * @code - * \Drupal::entityManager()->getStorage('entity_form_display')->load($entity_type . '.' . $bundle . '.' . $form_mode); + * \Drupal::entityTypeManager()->getStorage('entity_form_display')->load($entity_type . '.' . $bundle . '.' . $form_mode); * @endcode * When the entity form display is not available in configuration, you can create a new * EntityFormDisplay object using: @@ -530,7 +530,7 @@ * 'mode' => $form_mode, * 'status' => TRUE, * )); - * \Drupal::entityManager()->getStorage('entity_form_display')->create($values); + * \Drupal::entityTypeManager()->getStorage('entity_form_display')->create($values); * @endcode * * @see \Drupal\Core\Entity\EntityStorageInterface::create()