*/
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,