You are here

function flag_flag::save in Flag 6.2

Same name and namespace in other branches
  1. 5 flag.inc \flag_flag::save()
  2. 6 flag.inc \flag_flag::save()
  3. 7.3 includes/flag/flag_flag.inc \flag_flag::save()
  4. 7.2 flag.inc \flag_flag::save()

Saves a flag to the database. It is a wrapper around update() and insert().

File

./flag.inc, line 1046
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 save() {
  if (isset($this->fid)) {
    $this
      ->update();
    $this->is_new = FALSE;
  }
  else {
    $this
      ->insert();
    $this->is_new = TRUE;
  }

  // Clear the page cache for anonymous users.
  cache_clear_all('*', 'cache_page', TRUE);
}