You are here

function hook_webform_component_update in Webform 7.4

Same name and namespace in other branches
  1. 6.3 webform.api.php \hook_webform_component_update()
  2. 7.3 webform.api.php \hook_webform_component_update()

Respond to a Webform component being updated in the database.

Related topics

1 invocation of hook_webform_component_update()
webform_component_update in includes/webform.components.inc
Update an existing component with new values.

File

./webform.api.php, line 328
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_component_update($component) {

  // Update a record in a 3rd-party module table when a component is updated.
  db_update('mymodule_table')
    ->fields(array(
    'foo' => 'foo_data',
  ))
    ->condition('nid', $component['nid'])
    ->condition('cid', $component['cid'])
    ->execute();
}