Mercurial > hg > isophonics-drupal-site
diff core/lib/Drupal/Core/Entity/EntityManager.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | c2387f117808 |
children |
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Entity/EntityManager.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/lib/Drupal/Core/Entity/EntityManager.php Thu May 09 15:33:08 2019 +0100 @@ -31,6 +31,7 @@ * @see https://www.drupal.org/node/2549139 */ public function clearCachedDefinitions() { + @trigger_error('EntityManagerInterface::clearCachedDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::clearCachedDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_type.manager')->clearCachedDefinitions(); // @todo None of these are plugin managers, and they should not co-opt @@ -63,8 +64,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function hasHandler($entity_type, $handler_type) { - return $this->container->get('entity_type.manager')->hasHandler($entity_type, $handler_type); + public function hasHandler($entity_type_id, $handler_type) { + return $this->container->get('entity_type.manager')->hasHandler($entity_type_id, $handler_type); } /** @@ -75,8 +76,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function getStorage($entity_type) { - return $this->container->get('entity_type.manager')->getStorage($entity_type); + public function getStorage($entity_type_id) { + return $this->container->get('entity_type.manager')->getStorage($entity_type_id); } /** @@ -88,8 +89,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function getListBuilder($entity_type) { - return $this->container->get('entity_type.manager')->getListBuilder($entity_type); + public function getListBuilder($entity_type_id) { + return $this->container->get('entity_type.manager')->getListBuilder($entity_type_id); } /** @@ -101,8 +102,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function getFormObject($entity_type, $operation) { - return $this->container->get('entity_type.manager')->getFormObject($entity_type, $operation); + public function getFormObject($entity_type_id, $operation) { + return $this->container->get('entity_type.manager')->getFormObject($entity_type_id, $operation); } /** @@ -114,8 +115,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function getRouteProviders($entity_type) { - return $this->container->get('entity_type.manager')->getRouteProviders($entity_type); + public function getRouteProviders($entity_type_id) { + return $this->container->get('entity_type.manager')->getRouteProviders($entity_type_id); } /** @@ -127,8 +128,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function getViewBuilder($entity_type) { - return $this->container->get('entity_type.manager')->getViewBuilder($entity_type); + public function getViewBuilder($entity_type_id) { + return $this->container->get('entity_type.manager')->getViewBuilder($entity_type_id); } /** @@ -140,8 +141,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function getAccessControlHandler($entity_type) { - return $this->container->get('entity_type.manager')->getAccessControlHandler($entity_type); + public function getAccessControlHandler($entity_type_id) { + return $this->container->get('entity_type.manager')->getAccessControlHandler($entity_type_id); } /** @@ -152,8 +153,8 @@ * * @see https://www.drupal.org/node/2549139 */ - public function getHandler($entity_type, $handler_type) { - return $this->container->get('entity_type.manager')->getHandler($entity_type, $handler_type); + public function getHandler($entity_type_id, $handler_type) { + return $this->container->get('entity_type.manager')->getHandler($entity_type_id, $handler_type); } /** @@ -212,6 +213,20 @@ * {@inheritdoc} * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getActiveFieldStorageDefinitions() + * instead. + * + * @see https://www.drupal.org/node/3040966 + */ + public function getActiveFieldStorageDefinitions($entity_type_id) { + @trigger_error('EntityManagerInterface::getActiveFieldStorageDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getActiveFieldStorageDefinitions() instead. See https://www.drupal.org/node/3040966.', E_USER_DEPRECATED); + return $this->container->get('entity_field.manager')->getActiveFieldStorageDefinitions($entity_type_id); + } + + /** + * {@inheritdoc} + * + * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::setFieldMap() * instead. * @@ -257,6 +272,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definition) { + @trigger_error('EntityManagerInterface::onFieldDefinitionCreate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('field_definition.listener')->onFieldDefinitionCreate($field_definition); } @@ -270,6 +286,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original) { + @trigger_error('EntityManagerInterface::onFieldDefinitionUpdate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionUpdate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('field_definition.listener')->onFieldDefinitionUpdate($field_definition, $original); } @@ -283,6 +300,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition) { + @trigger_error('EntityManagerInterface::onFieldDefinitionDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('field_definition.listener')->onFieldDefinitionDelete($field_definition); } @@ -302,39 +320,42 @@ /** * {@inheritdoc} * - * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. + * @deprecated in drupal:8.0.0, will be removed before drupal:9.0.0. * Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::clearCachedBundles() * instead. * * @see https://www.drupal.org/node/2549139 */ public function clearCachedBundles() { + @trigger_error('EntityManagerInterface::clearCachedBundles() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::clearCachedBundles() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_type.bundle.info')->clearCachedBundles(); } /** * {@inheritdoc} * - * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. + * @deprecated in drupal:8.0.0, will be removed before drupal:9.0.0. * Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() * instead. * * @see https://www.drupal.org/node/2549139 */ public function getBundleInfo($entity_type_id) { + @trigger_error('EntityManagerInterface::getBundleInfo() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_type.bundle.info')->getBundleInfo($entity_type_id); } /** * {@inheritdoc} * - * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. + * @deprecated in drupal:8.0.0, will be removed before drupal:9.0.0. * Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() * instead. * * @see https://www.drupal.org/node/2549139 */ public function getAllBundleInfo() { + @trigger_error('EntityManagerInterface::getAllBundleInfo() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_type.bundle.info')->getAllBundleInfo(); } @@ -355,6 +376,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getEntityTypeLabels($group = FALSE) { + @trigger_error('EntityManagerInterface::getEntityTypeLabels() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeLabels() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_type.repository')->getEntityTypeLabels($group); } @@ -368,12 +390,68 @@ * @see https://www.drupal.org/node/2549139 */ public function getTranslationFromContext(EntityInterface $entity, $langcode = NULL, $context = []) { + @trigger_error('EntityManagerInterface::getTranslationFromContext() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::getTranslationFromContext() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity.repository')->getTranslationFromContext($entity, $langcode, $context); } /** * {@inheritdoc} * + * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityRepositoryInterface::getActive() instead. + * + * @see https://www.drupal.org/node/2549139 + */ + public function getActive($entity_type_id, $entity_id, array $contexts = NULL) { + @trigger_error('EntityManagerInterface::getActive() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getActive() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); + return $this->container->get('entity.repository')->getActive($entity_type_id, $entity_id, $contexts); + } + + /** + * {@inheritdoc} + * + * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityRepositoryInterface::getActiveMultiple() + * instead. + * + * @see https://www.drupal.org/node/2549139 + */ + public function getActiveMultiple($entity_type_id, array $entity_ids, array $contexts = NULL) { + @trigger_error('EntityManagerInterface::getActiveMultiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getActiveMultiple() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); + return $this->container->get('entity.repository')->getActiveMultiple($entity_type_id, $entity_ids, $contexts); + } + + /** + * {@inheritdoc} + * + * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonical() + * instead. + * + * @see https://www.drupal.org/node/2549139 + */ + public function getCanonical($entity_type_id, $entity_id, array $contexts = NULL) { + @trigger_error('EntityManagerInterface::getCanonical() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonical() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); + return $this->container->get('entity.repository')->getCanonical($entity_type_id, $entity_id, $contexts); + } + + /** + * {@inheritdoc} + * + * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonicalMultiple() + * instead. + * + * @see https://www.drupal.org/node/2549139 + */ + public function getCanonicalMultiple($entity_type_id, array $entity_ids, array $contexts = NULL) { + @trigger_error('EntityManagerInterface::getCanonicalMultiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonicalMultiple() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); + return $this->container->get('entity.repository')->getCanonicalMultiple($entity_type_id, $entity_ids, $contexts); + } + + /** + * {@inheritdoc} + * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes() * instead. @@ -381,6 +459,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getAllViewModes() { + @trigger_error('EntityManagerInterface::getAllViewModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getAllViewModes(); } @@ -394,6 +473,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getViewModes($entity_type_id) { + @trigger_error('EntityManagerInterface::getViewModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getViewModes($entity_type_id); } @@ -407,6 +487,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getAllFormModes() { + @trigger_error('EntityManagerInterface::getAllFormModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllFormModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getAllFormModes(); } @@ -420,6 +501,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getFormModes($entity_type_id) { + @trigger_error('EntityManagerInterface::getFormModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getFormModes($entity_type_id); } @@ -433,6 +515,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getViewModeOptions($entity_type_id) { + @trigger_error('EntityManagerInterface::getViewModeOptions() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getViewModeOptions($entity_type_id); } @@ -446,6 +529,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getFormModeOptions($entity_type_id) { + @trigger_error('EntityManagerInterface::getFormModeOptions() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getFormModeOptions($entity_type_id); } @@ -459,6 +543,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getViewModeOptionsByBundle($entity_type_id, $bundle) { + @trigger_error('EntityManagerInterface::getViewModeOptionsByBundle() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptionsByBundle() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getViewModeOptionsByBundle($entity_type_id, $bundle); } @@ -472,6 +557,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getFormModeOptionsByBundle($entity_type_id, $bundle) { + @trigger_error('EntityManagerInterface::getFormModeOptionsByBundle() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptionsByBundle() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_display.repository')->getFormModeOptionsByBundle($entity_type_id, $bundle); } @@ -485,6 +571,7 @@ * @see https://www.drupal.org/node/2549139 */ public function clearDisplayModeInfo() { + @trigger_error('EntityManagerInterface::clearDisplayModeInfo() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::clearDisplayModeInfo() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_display.repository')->clearDisplayModeInfo(); } @@ -498,6 +585,7 @@ * @see https://www.drupal.org/node/2549139 */ public function loadEntityByUuid($entity_type_id, $uuid) { + @trigger_error('EntityManagerInterface::loadEntityByUuid() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::loadEntityByUuid() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity.repository')->loadEntityByUuid($entity_type_id, $uuid); } @@ -511,6 +599,7 @@ * @see https://www.drupal.org/node/2549139 */ public function loadEntityByConfigTarget($entity_type_id, $target) { + @trigger_error('EntityManagerInterface::loadEntityByConfigTarget() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::loadEntityByConfigTarget() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity.repository')->loadEntityByConfigTarget($entity_type_id, $target); } @@ -524,6 +613,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getEntityTypeFromClass($class_name) { + @trigger_error('EntityManagerInterface::getEntityTypeFromClass() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeFromClass() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_type.repository')->getEntityTypeFromClass($class_name); } @@ -531,6 +621,7 @@ * {@inheritdoc} */ public function onEntityTypeCreate(EntityTypeInterface $entity_type) { + @trigger_error('EntityManagerInterface::onEntityTypeCreate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_type.listener')->onEntityTypeCreate($entity_type); } @@ -544,12 +635,26 @@ * @see https://www.drupal.org/node/2549139 */ public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) { + @trigger_error('EntityManagerInterface::onEntityTypeUpdate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeUpdate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_type.listener')->onEntityTypeUpdate($entity_type, $original); } /** * {@inheritdoc} * + * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onFieldableEntityTypeUpdate() + * instead. + * + * @see https://www.drupal.org/project/drupal/issues/2984782 + */ + public function onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, array &$sandbox = NULL) { + $this->container->get('entity_type.listener')->onFieldableEntityTypeUpdate($entity_type, $original, $field_storage_definitions, $original_field_storage_definitions, $sandbox); + } + + /** + * {@inheritdoc} + * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeDelete() * instead. @@ -557,6 +662,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onEntityTypeDelete(EntityTypeInterface $entity_type) { + @trigger_error('EntityManagerInterface::onEntityTypeDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_type.listener')->onEntityTypeDelete($entity_type); } @@ -570,6 +676,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) { + @trigger_error('EntityManagerInterface::onFieldStorageDefinitionCreate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definition); } @@ -583,6 +690,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) { + @trigger_error('EntityManagerInterface::onFieldStorageDefinitionUpdate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionUpdate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionUpdate($storage_definition, $original); } @@ -596,6 +704,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) { + @trigger_error('EntityManagerInterface::onFieldStorageDefinitionDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionDelete($storage_definition); } @@ -609,6 +718,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onBundleCreate($bundle, $entity_type_id) { + @trigger_error('EntityManagerInterface::onBundleCreate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_bundle.listener')->onBundleCreate($bundle, $entity_type_id); } @@ -622,6 +732,7 @@ * @see https://www.drupal.org/node/2549139 */ public function onBundleDelete($bundle, $entity_type_id) { + @trigger_error('EntityManagerInterface::onBundleDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_bundle.listener')->onBundleDelete($bundle, $entity_type_id); } @@ -635,13 +746,22 @@ * @see https://www.drupal.org/node/2549139 */ public function getLastInstalledDefinition($entity_type_id) { + @trigger_error('EntityManagerInterface::getLastInstalledDefinition() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinition() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity.last_installed_schema.repository')->getLastInstalledDefinition($entity_type_id); } /** * {@inheritdoc} + * + * @deprecated EntityManagerInterface::useCaches() is deprecated in 8.0.0 and + * will be removed before Drupal 9.0.0. Use + * \Drupal\Core\Entity\EntityTypeManagerInterface::useCaches() and/or + * Drupal\Core\Entity\EntityFieldManagerInterface::useCaches() instead. + * + * @see https://www.drupal.org/node/2549139 */ public function useCaches($use_caches = FALSE) { + @trigger_error('EntityManagerInterface::useCaches() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::useCaches() and/or Drupal\Core\Entity\EntityFieldManagerInterface::useCaches() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); $this->container->get('entity_type.manager')->useCaches($use_caches); // @todo EntityFieldManager is not a plugin manager, and should not co-opt @@ -659,6 +779,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getLastInstalledFieldStorageDefinitions($entity_type_id) { + @trigger_error('EntityManagerInterface::getLastInstalledFieldStorageDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledFieldStorageDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions($entity_type_id); } @@ -692,12 +813,27 @@ * {@inheritdoc} * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getActiveDefinition() + * instead. + * + * @see https://www.drupal.org/node/3040966 + */ + public function getActiveDefinition($entity_type_id) { + @trigger_error('EntityManagerInterface::getActiveDefinition() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::getActiveDefinition() instead. See https://www.drupal.org/node/3040966.', E_USER_DEPRECATED); + return $this->container->get('entity_type.manager')->getActiveDefinition($entity_type_id); + } + + /** + * {@inheritdoc} + * + * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::createInstance() * instead. * * @see https://www.drupal.org/node/2549139 */ public function createInstance($plugin_id, array $configuration = []) { + @trigger_error('EntityManagerInterface::createInstance() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::createInstance() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_type.manager')->createInstance($plugin_id, $configuration); } @@ -711,6 +847,7 @@ * @see https://www.drupal.org/node/2549139 */ public function getInstance(array $options) { + @trigger_error('EntityManagerInterface::getInstance() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::getInstance() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED); return $this->container->get('entity_type.manager')->getInstance($options); }