You are here

function authcache_p13n_config_cache_granularity in Authenticated User Page Caching (Authcache) 7.2

Utility: Return cache granularity flags.

Parameters

array $config: The value produced by the authcache_p13n_config widget.

Return value

int A combination of cache granularity flags.

Related topics

5 calls to authcache_p13n_config_cache_granularity()
AuthcacheP13nTestConfigWidget::testConfigCacheGranularity in modules/authcache_p13n/tests/authcache_p13n.config.test
Cover authcache_p13n_config_cache_granularity().
authcache_block_authcache_p13n_fragment in modules/authcache_block/authcache_block.module
Implements hook_authcache_p13n_fragment().
authcache_field_authcache_p13n_assembly in modules/authcache_field/authcache_field.module
Implements hook_authcache_p13n_assembly().
authcache_panels_pane_fragment in modules/authcache_panels/authcache_panels.module
Return fragment renderer for the given panel pane.
authcache_views_authcache_p13n_fragment in modules/authcache_views/authcache_views.module
Implements hook_authcache_p13n_fragment().

File

modules/authcache_p13n/authcache_p13n.module, line 1546
Provides methods for serving personalized content fragments.

Code

function authcache_p13n_config_cache_granularity($config) {
  $result = 0;
  if (!empty($config['peruser'])) {
    $result |= AuthcacheP13nCacheGranularity::PER_USER;
  }
  if (!empty($config['perpage'])) {
    $result |= AuthcacheP13nCacheGranularity::PER_PAGE;
  }
  return $result;
}