You are here

function flag_lists_insert in Flag Lists 7

Same name and namespace in other branches
  1. 6 flag_lists.module \flag_lists_insert()
  2. 7.3 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 1292
The Flag Lists module.

Code

function flag_lists_insert($flag) {
  $flag->fid = db_insert('flag_lists_flags')
    ->fields(array(
    'pfid' => $flag->pfid,
    'uid' => $flag->uid,
    'content_type' => $flag->content_type,
    'name' => $flag->name,
    'title' => $flag->title,
    'options' => $flag
      ->get_serialized_options($flag),
  ))
    ->execute();
  $flag->name = 'flag_lists_' . $flag->uid . '_' . $flag->fid;
  flag_lists_update($flag);
}