summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-22 22:51:54 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-22 22:51:54 +0000
commit8cb52e47c1d0ea1009921c14d585b0194b532ec5 (patch)
tree0971084fd20879fe4eed0622c2d822c75bf811d7
parent453032c1171756066f0d2de2367b0098e9fd8d46 (diff)
downloadbrdo-8cb52e47c1d0ea1009921c14d585b0194b532ec5.tar.gz
brdo-8cb52e47c1d0ea1009921c14d585b0194b532ec5.tar.bz2
- Patch #777092 by jhodgdon, puregin: field purge hooks are not documented.
-rw-r--r--modules/field/field.api.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/field/field.api.php b/modules/field/field.api.php
index 95f436c43..da84eb23c 100644
--- a/modules/field/field.api.php
+++ b/modules/field/field.api.php
@@ -1638,6 +1638,42 @@ function hook_field_read_instance($instance) {
}
/**
+ * Acts when a field record is being purged.
+ *
+ * In field_purge_field(), after the field configuration has been
+ * removed from the database, the field storage module has had a chance to
+ * run its hook_field_storage_purge_field(), and the field info cache
+ * has been cleared, this hook is invoked on all modules to allow them to
+ * respond to the field being purged.
+ *
+ * @param $field
+ * The field being purged.
+ */
+function hook_field_purge_field($field) {
+ db_delete('my_module_field_info')
+ ->condition('id', $field['id'])
+ ->execute();
+}
+
+/**
+ * Acts when a field instance is being purged.
+ *
+ * In field_purge_instance(), after the field instance has been
+ * removed from the database, the field storage module has had a chance to
+ * run its hook_field_storage_purge_instance(), and the field info cache
+ * has been cleared, this hook is invoked on all modules to allow them to
+ * respond to the field instance being purged.
+ *
+ * @param $instance
+ * The instance being purged.
+ */
+function hook_field_purge_field_instance($instance) {
+ db_delete('my_module_field_instance_info')
+ ->condition('id', $instance['id'])
+ ->execute();
+}
+
+/**
* @} End of "ingroup field_crud"
*/