diff -u b/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php --- b/core/lib/Drupal/Core/Entity/entity.api.php +++ b/core/lib/Drupal/Core/Entity/entity.api.php @@ -938,12 +938,12 @@ */ function hook_entity_insert(Drupal\Core\Entity\EntityInterface $entity) { // Insert the new entity into a fictional table of all entities. - \Drupal::database()->insert('example_entity') + db_insert('example_entity') ->fields(array( */ function hook_entity_insert(Drupal\Core\Entity\EntityInterface $entity) { // Insert the new entity into a fictional table of all entities. - db_insert('example_entity') + \Drupal::database()->insert('example_entity') ->fields([ 'type' => $entity->getEntityTypeId(), 'id' => $entity->id(), @@ -962,12 +962,12 @@ */ function hook_ENTITY_TYPE_insert(Drupal\Core\Entity\EntityInterface $entity) { // Insert the new entity into a fictional table of this type of entity. - \Drupal::database()->insert('example_entity') + db_insert('example_entity') ->fields(array( */ function hook_ENTITY_TYPE_insert(Drupal\Core\Entity\EntityInterface $entity) { // Insert the new entity into a fictional table of this type of entity. - db_insert('example_entity') + \Drupal::database()->insert('example_entity') ->fields([ 'id' => $entity->id(), 'created' => REQUEST_TIME,