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_TYPE_insert.twig
index 1d639bac14e5f09d7a279ec897deed38d5dee50f..744ad48931166cb20ddf4663c12e879d4adde4e3 100644 (file)
@@ -3,7 +3,7 @@
  */
 function {{ machine_name }}_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,