abstract class AbstractBaseController in Render cache 7.2
Controller abstract base class.
Hierarchy
- class \Drupal\render_cache\RenderCache\Controller\AbstractBaseController extends \Drupal\Component\Plugin\PluginBase implements ControllerInterface
Expanded class hierarchy of AbstractBaseController
File
- src/
RenderCache/ Controller/ AbstractBaseController.php, line 16 - Contains \Drupal\render_cache\RenderCache\Controller\AbstractBaseController
Namespace
Drupal\render_cache\RenderCache\ControllerView source
abstract class AbstractBaseController extends PluginBase implements ControllerInterface {
// -----------------------------------------------------------------------
// Suggested implementation functions.
/**
* @param array $default_cache_info
* @param array $context
*
* @return bool
*/
protected abstract function isCacheable(array $default_cache_info, array $context);
/**
* Provides the cache info for all objects based on the context.
*
* @param array $context
*
* @return array
*/
protected abstract function getDefaultCacheInfo($context);
/**
* @param object $object
* @param array $context
*
* @return array
*/
protected abstract function getCacheContext($object, array $context);
/**
* Specific cache info overrides based on the $object.
*
* @param object $object
* @param array $context
*
* @return array
*/
protected abstract function getCacheInfo($object, array $context);
/**
* @param object $object
* @param array $context
*
* @return array
*/
protected abstract function getCacheKeys($object, array $context);
/**
* @param object $object
* @param array $context
*
* @return array
*/
protected abstract function getCacheHash($object, array $context);
/**
* @param object $object
* @param array $context
*
* @return array
*/
protected abstract function getCacheTags($object, array $context);
/**
* @param object $object
* @param array $context
*
* @return array
*/
protected abstract function getCacheValidate($object, array $context);
/**
* Render uncached objects.
*
* This function needs to be implemented by every child class.
*
* @param array $objects
* Array of $objects to be rendered keyed by id.
*
* @return array
* Render array keyed by id.
*/
protected abstract function render(array $objects);
/**
* Renders uncached objects in a recursion compatible way.
*
* The default implementation is dumb and expensive performance wise, as
* it calls the render() method for each object seperately.
*
* Controllers that support recursions should implement the
* RecursionControllerInterface and subclass from
* BaseRecursionController.
*
* @see \Drupal\render_cache\RenderCache\Controller\RecursionControllerInterface
* @see \Drupal\render_cache\RenderCache\Controller\BaseRecursionController
*
* @param object[] $objects
* Array of $objects to be rendered keyed by id.
*
* @return array[]
* Render array keyed by id.
*/
protected abstract function renderRecursive(array $objects);
// -----------------------------------------------------------------------
// Helper functions.
/**
* Provides the fully pouplated cache information for a specific object.
*
* @param object $object
* @param array $cache_info
* @param array $context
*
* @return array
*/
protected abstract function getCacheIdInfo($object, array $cache_info = array(), array $context = array());
/**
* @param string $type
* @param array $data
* @param mixed|null $context1
* @param mixed|null $context2
* @param mixed|null $context3
*/
protected abstract function alter($type, &$data, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractBaseController:: |
abstract protected | function | 1 | |
AbstractBaseController:: |
abstract protected | function | 1 | |
AbstractBaseController:: |
abstract protected | function | 1 | |
AbstractBaseController:: |
abstract protected | function | Provides the fully pouplated cache information for a specific object. | 1 |
AbstractBaseController:: |
abstract protected | function | Specific cache info overrides based on the $object. | 1 |
AbstractBaseController:: |
abstract protected | function | 1 | |
AbstractBaseController:: |
abstract protected | function | 1 | |
AbstractBaseController:: |
abstract protected | function | 1 | |
AbstractBaseController:: |
abstract protected | function | Provides the cache info for all objects based on the context. | 1 |
AbstractBaseController:: |
abstract protected | function | 1 | |
AbstractBaseController:: |
abstract protected | function | Render uncached objects. | 3 |
AbstractBaseController:: |
abstract protected | function | Renders uncached objects in a recursion compatible way. | 1 |
ControllerInterface:: |
public | function | 1 | |
ControllerInterface:: |
public static | function | 1 | |
ControllerInterface:: |
public | function | 1 | |
ControllerInterface:: |
public | function | 1 | |
ControllerInterface:: |
public | function | 1 |