class BlockCacheKind

Encapsulates some block caching bitmask constants referenced in hook_block_info().

'cache: (optional) A bitmask describing what kind of caching is appropriate for the block. Drupal provides the following bitmask constants for defining cache granularity:

DRUPAL_CACHE_PER_ROLE (default): The block can change depending on the roles the user viewing the page belongs to.

DRUPAL_CACHE_PER_USER: The block can change depending on the user viewing the page. This setting can be resource-consuming for sites with large number of users, and should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient.

DRUPAL_CACHE_PER_PAGE: The block can change depending on the page being viewed.

DRUPAL_CACHE_GLOBAL: The block is the same for every user on every page where it is visible.

DRUPAL_CACHE_CUSTOM: The module implements its own caching system.

DRUPAL_NO_CACHE: The block should not get cached.'

UML: BlockCacheKind

@author darrenkelly

Hierarchy

Expanded class hierarchy of BlockCacheKind

1 file declares its use of BlockCacheKind
AbstractProject.php in lib/Drupal/ooe/Project/AbstractProject.php
AbstractProject

File

lib/Drupal/ooe/Block/BlockCacheKind.php, line 41
BlockCacheKind

Namespace

Drupal\ooe\Block
View source
class BlockCacheKind {

  /**
   * '(default): The block can change depending on
   * the roles the user viewing the page belongs to.'
   */
  const CACHE_PER_ROLE = DRUPAL_CACHE_PER_ROLE;

  /**
   * 'The block can change depending on the user viewing the page.
   * This setting can be resource-consuming
   * for sites with large number of users,
   * and should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient.'
   */
  const CACHE_PER_USER = DRUPAL_CACHE_PER_USER;

  /**
   * 'The block can change depending on the page being viewed.'
   */
  const CACHE_PER_PAGE = DRUPAL_CACHE_PER_PAGE;

  /**
   * 'The block is the same for every user
   *  on every page where it is visible.'
   */
  const CACHE_GLOBAL = DRUPAL_CACHE_GLOBAL;

  /**
   * 'The module implements its own caching system.'
   */
  const CACHE_CUSTOM = DRUPAL_CACHE_CUSTOM;

  /**
   * 'The block should not get cached.'
   */
  const NO_CACHE = DRUPAL_NO_CACHE;

}

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
BlockCacheKind::CACHE_CUSTOM constant 'The module implements its own caching system.'
BlockCacheKind::CACHE_GLOBAL constant 'The block is the same for every user on every page where it is visible.'
BlockCacheKind::CACHE_PER_PAGE constant 'The block can change depending on the page being viewed.'
BlockCacheKind::CACHE_PER_ROLE constant '(default): The block can change depending on the roles the user viewing the page belongs to.'
BlockCacheKind::CACHE_PER_USER constant 'The block can change depending on the user viewing the page. This setting can be resource-consuming for sites with large number of users, and should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient.'
BlockCacheKind::NO_CACHE constant 'The block should not get cached.'