You are here

function multifield_save in Multifield 7.2

Same name and namespace in other branches
  1. 7 multifield.module \multifield_save()
2 calls to multifield_save()
MultifieldUnitTestCase::testDeprecatedField in tests/MultifieldUnitTestCase.test
multifield_edit_form_submit in ./multifield.admin.inc
1 string reference to 'multifield_save'
multifield_schema in ./multifield.install
Implements hook_schema().

File

./multifield.module, line 156

Code

function multifield_save($multifield) {
  $return = NULL;
  module_invoke_all('multifield_presave', $multifield);
  if (!empty($multifield->mfid)) {

    // Existing record.
    $return = drupal_write_record('multifield', $multifield, array(
      'machine_name',
    ));
    module_invoke_all('mulifield_update', $multifield);
  }
  else {
    $return = drupal_write_record('multifield', $multifield, array());
    module_invoke_all('multifield_insert', $multifield);
    field_attach_create_bundle('multifield', $multifield->machine_name);
  }
  multifield_cache_clear();
  return $return;
}