Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / entity_insert.twig
index f57c3467dac7616b43abd7052d5d6c4c222798fe..5fa1b9a94789510ca9428bf4ef9d0b1e459f9f7a 100644 (file)
@@ -3,7 +3,7 @@
  */
 function {{ machine_name }}_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(),