You are here

function flag_lists_insert in Flag Lists 6

Same name and namespace in other branches
  1. 7.3 flag_lists.module \flag_lists_insert()
  2. 7 flag_lists.module \flag_lists_insert()

Saves a new flag to the database. Better use save($flag).

1 call to flag_lists_insert()
flag_lists_save in ./flag_lists.module
Saves a flag to the database. It is a wrapper around update($flag) and insert($flag).

File

./flag_lists.module, line 852
The Flag Lists module.

Code

function flag_lists_insert($flag) {
  db_query("INSERT INTO {flag_lists_flags} (pfid, uid, content_type, name, title, options) VALUES (%d, %d, '%s', '%s', '%s', '%s')", $flag->pfid, $flag->uid, $flag->content_type, $flag->name, $flag->title, $flag
    ->get_serialized_options($flag));
  $flag->fid = db_last_insert_id('flag_lists_flags', 'fid');
  $flag->name = 'flag_lists_' . $flag->uid . '_' . $flag->fid;
  flag_lists_update($flag);
}