field_sql_storage_field_storage_purge

Versions
7
field_sql_storage_field_storage_purge($obj_type, $object, $field, $instance)

Implements hook_field_storage_purge().

This function deletes data from the database for a single field on an object.

Code

modules/field/modules/field_sql_storage/field_sql_storage.module, line 456

<?php
function field_sql_storage_field_storage_purge($obj_type, $object, $field, $instance) {
  list($id, $vid, $bundle) = entity_extract_ids($obj_type, $object);
  $etid = _field_sql_storage_etid($obj_type);

  $table_name = _field_sql_storage_tablename($field);
  $revision_name = _field_sql_storage_revision_tablename($field);
  db_delete($table_name)
    ->condition('etid', $etid)
    ->condition('entity_id', $id)
    ->execute();
  db_delete($revision_name)
    ->condition('etid', $etid)
    ->condition('entity_id', $id)
    ->execute();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.