You are here

function hook_webform_component_insert in Webform 7.4

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

Respond to a Webform component being inserted into the database.

Related topics

1 invocation of hook_webform_component_insert()
webform_component_insert in includes/webform.components.inc
Insert a new component into the database.

File

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

Code

function hook_webform_component_insert($component) {

  // Insert a record into a 3rd-party module table when a component is inserted.
  db_insert('mymodule_table')
    ->fields(array(
    'nid' => $component['nid'],
    'cid' => $component['cid'],
    'foo' => 'foo_data',
  ))
    ->execute();
}