Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / entity_update.twig
1 /**
2  * Implements hook_entity_update().
3  */
4 function {{ machine_name }}_entity_update(Drupal\Core\Entity\EntityInterface $entity) {
5   // Update the entity's entry in a fictional table of all entities.
6   db_update('example_entity')
7     ->fields([
8       'updated' => REQUEST_TIME,
9     ])
10     ->condition('type', $entity->getEntityTypeId())
11     ->condition('id', $entity->id())
12     ->execute();
13 }