function simplemeta_meta_save in Simple Meta 6.2
Same name and namespace in other branches
- 7 simplemeta.module \simplemeta_meta_save()
Save meta data
1 call to simplemeta_meta_save()
File
- ./
simplemeta.module, line 192
Code
function simplemeta_meta_save($meta) {
$is_new = !isset($meta->sid) && !simplemeta_meta_load_by_path($meta->path, $meta->language);
$meta->fit = _simplemeta_meta_calculate_fit($meta->path);
$record = drupal_clone($meta);
$record->data = serialize($record->data);
if ($is_new) {
$result = drupal_write_record('simplemeta', $record);
if (!empty($record->sid)) {
$meta->sid = $record->sid;
}
module_invoke_all('simplemeta', $meta, 'insert');
}
else {
$result = drupal_write_record('simplemeta', $record, array(
'path',
));
module_invoke_all('simplemeta', $meta, 'update');
}
return $result;
}