function flag_flag::is_compatible in Flag 7.3
Same name and namespace in other branches
- 6.2 flag.inc \flag_flag::is_compatible()
- 7.2 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
- includes/
flag/ flag_flag.inc, line 1442 - Contains the flag_flag class. Flag type classes use an 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;
}
}