function hook_ucxf_field in Extra Fields Checkout Pane 7
Same name and namespace in other branches
- 6.2 uc_extra_fields_pane.api.php \hook_ucxf_field()
Perform actions when something happens with a field. Note that this only about the field itself, not about filled in values by customers.
Parameters
UCXF_Field $field: An instance of UCXF_Field, representing a row from the uc_extra_fields table.
string $op: The action that is occurring. Possible values:
- load: called when the field data is loaded. This hook is invoked in uc_extra_fields_pane_field_load().
- insert: called when a new field is created. This hook is invoked in the method save() from the UCXF_Field class.
- update: called when a field's settings is updated. This hook is invoked in the method save() from the UCXF_Field class.
- delete: called when a field is deleted. This hook is invoked in the method delete() from the UCXF_Field class.
Return value
void
1 function implements hook_ucxf_field()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- uc_extra_fields_pane_ucxf_field in ./
uc_extra_fields_pane.module - Implementation of hook_ucxf_field().
3 invocations of hook_ucxf_field()
- UCXF_Field::save in class/
UCXF_Field.class.php - save() Saves field in database @access public
- UCXF_FieldList::dbResultToField in class/
UCXF_FieldList.class.php - Creates UCXF_Field objects from a database resource.
- UCXF_FieldList::deleteOne in class/
UCXF_FieldList.class.php - Deletes one field
File
- ./
uc_extra_fields_pane.api.php, line 32 - These hooks are invoked by the Extra Fields Pane module.
Code
function hook_ucxf_field($field, $op) {
switch ($op) {
case 'delete':
// The field is deleted, delete previous filled in values (this does not
// happen by default).
db_delete('uc_extra_fields_values')
->condition('field_id', $field->field_id)
->execute();
break;
}
}