diff core/includes/entity.inc @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
line wrap: on
line diff
--- a/core/includes/entity.inc	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/includes/entity.inc	Thu May 09 15:33:08 2019 +0100
@@ -11,8 +11,17 @@
 
 /**
  * Clears the entity render cache for all entity types.
+ *
+ * @deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Instead,
+ *   use \Drupal\Core\Entity\EntityViewBuilderInterface::resetCache() on the
+ *   required entity types or invalidate specific cache tags.
+ *
+ * @see https://www.drupal.org/node/3000037
+ * @see \Drupal\Core\Entity\EntityViewBuilderInterface::resetCache()
+ * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinitions()
  */
 function entity_render_cache_clear() {
+  @trigger_error(__FUNCTION__ . '() is deprecated. Use \Drupal\Core\Entity\EntityViewBuilderInterface::resetCache() on the required entity types or invalidate specific cache tags instead. See https://www.drupal.org/node/3000037', E_USER_DEPRECATED);
   $entity_manager = Drupal::entityManager();
   foreach ($entity_manager->getDefinitions() as $entity_type => $info) {
     if ($entity_manager->hasHandler($entity_type, 'view_builder')) {
@@ -62,22 +71,13 @@
  * @return \Drupal\Core\Entity\EntityInterface|null
  *   The entity object, or NULL if there is no entity with the given ID.
  *
- * @deprecated in Drupal 8.0.x, will be removed before Drupal 9.0.0. Use
- *   The method overriding Entity::load() for the entity type, e.g.
- *   \Drupal\node\Entity\Node::load() if the entity type is known. If the
- *   entity type is variable, use the entity manager service to load the entity
- *   from the entity storage:
- *   @code
- *     \Drupal::entityTypeManager()->getStorage($entity_type)->load($id);
- *   @endcode
+ * @deprecated in Drupal 8.0.x, will be removed before Drupal 9.0.0. Use the
+ *   entity type storage's load() method.
  *
- * @see \Drupal\Core\Entity\EntityInterface::load()
- * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()
- * @see \Drupal\Core\Entity\EntityStorageInterface::load()
- * @see \Drupal\Core\Entity\Sql\SqlContentEntityStorage
- * @see \Drupal\Core\Entity\Query\QueryInterface
+ * @see https://www.drupal.org/node/2266845
  */
 function entity_load($entity_type, $id, $reset = FALSE) {
+  @trigger_error('entity_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s load() method. See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
   $controller = \Drupal::entityManager()->getStorage($entity_type);
   if ($reset) {
     $controller->resetCache([$id]);
@@ -170,22 +170,13 @@
  * @return array
  *   An array of entity objects indexed by their IDs.
  *
- * @deprecated in Drupal 8.0.x, will be removed before Drupal 9.0.0. Use
- *   The method overriding Entity::loadMultiple() for the entity type, e.g.
- *   \Drupal\node\Entity\Node::loadMultiple() if the entity type is known. If
- *   the entity type is variable, use the entity manager service to load the
- *   entity from the entity storage:
- *   @code
- *     \Drupal::entityTypeManager()->getStorage($entity_type)->loadMultiple($id);
- *   @endcode
+ * @deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the
+ *   entity type storage's loadMultiple() method.
  *
- * @see \Drupal\Core\Entity\EntityInterface::loadMultiple()
- * @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()
- * @see \Drupal\Core\Entity\EntityStorageInterface::loadMultiple()
- * @see \Drupal\Core\Entity\Sql\SqlContentEntityStorage
- * @see \Drupal\Core\Entity\Query\QueryInterface
+ * @see https://www.drupal.org/node/2266845
  */
 function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) {
+  @trigger_error('entity_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s loadMultiple() method. See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
   $controller = \Drupal::entityManager()->getStorage($entity_type);
   if ($reset) {
     $controller->resetCache($ids);