You are here

public function AuthcacheFlagFlagFragment::load in Authenticated User Page Caching (Authcache) 7.2

Load the objects designated by the given list of keys.

Parameters

array $keys: A list of strings representing the keys of the fragment(s) to load.

array $context: Additional run-time per-request context (key-value pairs).

Return value

array An associative array of key-value pairs where keys correspond to the input keys and the values to the objects loaded from the database.

Throws

AuthcacheP13nRequestNotFound

Overrides AuthcacheP13nFragmentLoaderInterface::load

File

modules/authcache_flag/includes/AuthcacheFlagFlagFragment.inc, line 26
Defines a personalization fragment for retrieving flags. on a node.

Class

AuthcacheFlagFlagFragment
Personalization fragment for retrieving flags.

Code

public function load($entity_ids, $context) {
  $flag = flag_get_flag($this->flagName);
  if (!$flag) {
    throw new AuthcacheP13nRequestNotFound();
  }
  return array_fill_keys($entity_ids, $flag);
}