You are here

static function FlagCookieStorage::factory in Flag 7.2

Same name and namespace in other branches
  1. 6.2 flag.inc \FlagCookieStorage::factory()
  2. 7.3 includes/flag.cookie_storage.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 1882
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);
  }
}