function flag_flag::update in Flag 7.2
Same name and namespace in other branches
- 5 flag.inc \flag_flag::update()
- 6.2 flag.inc \flag_flag::update()
- 6 flag.inc \flag_flag::update()
- 7.3 includes/flag/flag_flag.inc \flag_flag::update()
Saves an existing flag to the database. Better use save().
1 call to flag_flag::update()
- flag_flag::save in ./
flag.inc - Saves a flag to the database. It is a wrapper around update() and insert().
File
- ./
flag.inc, line 1114 - Implements various flags. Uses object oriented style inspired by that of Views 2.
Class
- flag_flag
- This abstract class represents a flag, or, in Views 2 terminology, "a handler".
Code
function update() {
db_update('flags')
->fields(array(
'name' => $this->name,
'title' => $this->title,
'global' => $this->global,
'options' => $this
->get_serialized_options(),
))
->condition('fid', $this->fid)
->execute();
db_delete('flag_types')
->condition('fid', $this->fid)
->execute();
foreach ($this->types as $type) {
db_insert('flag_types')
->fields(array(
'fid' => $this->fid,
'type' => $type,
))
->execute();
}
}