You are here

static function FlagCookieStorage::factory in Flag 6.2

Same name and namespace in other branches
  1. 7.3 includes/flag.cookie_storage.inc \FlagCookieStorage::factory()
  2. 7.2 flag.inc \FlagCookieStorage::factory()

Returns the actual storage object compatible with the flag.

2 calls to FlagCookieStorage::factory()
flag_flag::_flag_anonymous in ./flag.inc
Set a cookie for anonymous users to record their flagging.
flag_flag::_unflag_anonymous in ./flag.inc
Remove the cookie for anonymous users to record their unflagging.

File

./flag.inc, line 1791
Implements various flags. Uses object oriented style inspired by that of Views 2.

Class

FlagCookieStorage
Utility class to handle cookies.

Code

static function factory($flag) {
  if ($flag->global) {
    return new FlagGlobalCookieStorage($flag);
  }
  else {
    return new FlagNonGlobalCookieStorage($flag);
  }
}