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