Pull merge.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_storage_purge.twig
1 /**
2  * Implements hook_field_storage_purge().
3  */
4 function {{ machine_name }}_field_storage_purge($entity_type, $entity, $field, $instance) {
5   list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
6
7   $table_name = _field_sql_storage_tablename($field);
8   $revision_name = _field_sql_storage_revision_tablename($field);
9   db_delete($table_name)
10     ->condition('entity_type', $entity_type)
11     ->condition('entity_id', $id)
12     ->execute();
13   db_delete($revision_name)
14     ->condition('entity_type', $entity_type)
15     ->condition('entity_id', $id)
16     ->execute();
17 }