You are here

interface SimplenewsSourceCacheInterface in Simplenews 7.2

Same name and namespace in other branches
  1. 7 includes/simplenews.source.inc \SimplenewsSourceCacheInterface

Interface for a simplenews source cache implementation.

This is only compatible with the SimplenewsSourceNodeInterface interface.

Hierarchy

Expanded class hierarchy of SimplenewsSourceCacheInterface

All classes that implement SimplenewsSourceCacheInterface

Related topics

File

includes/simplenews.source.inc, line 144
Contains SimplenewsSource interface and implementations.

View source
interface SimplenewsSourceCacheInterface {

  /**
   * Create a new instance, allows to initialize based on the used
   * source.
   */
  function __construct(SimplenewsSourceEntityInterface $source);

  /**
   * Return a cached element, if existing.
   *
   * Although group and key can be used to identify the requested cache, the
   * implementations are responsible to create a unique cache key themself using
   * the $source. For example based on the node id and the language.
   *
   * @param $group
   *   Group of the cache key, which allows cache implementations to decide what
   *   they want to cache. Currently used groups:
   *     - data: Raw data, e.g. attachments.
   *     - build: Built and themed content, before personalizations like tokens.
   *     - final: The final returned data. Caching this means that newsletter
   *       can not be personalized anymore.
   * @param $key
   *   Identifies the requested element, e.g. body, footer or attachments.
   */
  function get($group, $key);

  /**
   * Write an element to the cache.
   *
   * Although group and key can be used to identify the requested cache, the
   * implementations are responsible to create a unique cache key themself using
   * the $source. For example based on the node id and the language.
   *
   * @param $group
   *   Group of the cache key, which allows cache implementations to decide what
   *   they want to cache. Currently used groups:
   *     - data: Raw data, e.g. attachments.
   *     - build: Built and themed content, before personalizations like tokens.
   *     - final: The final returned data. Caching this means that newsletter
   *       can not be personalized anymore.
   * @param $key
   *   Identifies the requested element, e.g. body, footer or attachments.
   * @param $data
   *   The data to be saved in the cache.
   */
  function set($group, $key, $data);

}

Members

Namesort descending Modifiers Type Description Overrides
SimplenewsSourceCacheInterface::get function Return a cached element, if existing. 1
SimplenewsSourceCacheInterface::set function Write an element to the cache. 1
SimplenewsSourceCacheInterface::__construct function Create a new instance, allows to initialize based on the used source. 1