You are here

function flag_flag::is_compatible in Flag 7.2

Same name and namespace in other branches
  1. 6.2 flag.inc \flag_flag::is_compatible()
  2. 7.3 includes/flag/flag_flag.inc \flag_flag::is_compatible()

Returns TRUE if this flag's declared API version is compatible with this module.

An "incompatible" flag is one exported (and now being imported or exposed via hook_flag_default_flags()) by a different version of the Flag module. An incompatible flag should be treated as a "black box": it should not be saved or exported because our code may not know to handle its internal structure.

File

./flag.inc, line 1187
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 is_compatible() {
  if (isset($this->fid)) {

    // Database flags are always compatible.
    return TRUE;
  }
  else {
    if (!isset($this->api_version)) {
      $this->api_version = 1;
    }
    return $this->api_version == FLAG_API_VERSION;
  }
}