You are here

function webform_component_update in Webform 6.2

Same name and namespace in other branches
  1. 5.2 webform_components.inc \webform_component_update()
  2. 6.3 includes/webform.components.inc \webform_component_update()
  3. 7.4 includes/webform.components.inc \webform_component_update()
  4. 7.3 includes/webform.components.inc \webform_component_update()

Update an existing component with new values.

Parameters

$component: A full component containing a nid, cid, and all other fields from the component form. Additional properties are stored in the extra array.

2 calls to webform_component_update()
webform_components_form_submit in ./webform_components.inc
webform_component_edit_form_submit in ./webform_components.inc

File

./webform_components.inc, line 528
Webform module components handling.

Code

function webform_component_update($component) {
  $component['value'] = isset($component['value']) ? $component['value'] : NULL;
  $component['mandatory'] = isset($component['mandatory']) ? $component['mandatory'] : 0;
  return db_query("UPDATE {webform_component} SET pid = %d, form_key = '%s', name = '%s', type = '%s', value = '%s', extra = '%s', mandatory = %d, weight = %d, email = %d WHERE nid = %d AND cid = %d", $component['pid'], $component['form_key'], $component['name'], $component['type'], $component['value'], serialize($component['extra']), $component['mandatory'], $component['weight'], $component['email'], $component['nid'], $component['cid']);
}