class AuthcacheBlockFragment in Authenticated User Page Caching (Authcache) 7.2
Fragment handler for blocks.
Hierarchy
Expanded class hierarchy of AuthcacheBlockFragment
See also
1 string reference to 'AuthcacheBlockFragment'
- authcache_block_authcache_p13n_fragment in modules/
authcache_block/ authcache_block.module - Implements hook_authcache_p13n_fragment().
File
- modules/
authcache_block/ includes/ AuthcacheBlockFragment.inc, line 12 - Defines fragment for blocks.
View source
class AuthcacheBlockFragment implements AuthcacheP13nFragmentInterface, AuthcacheP13nFragmentLoaderInterface {
protected $blockId;
protected $module;
protected $delta;
/**
* Construct new personalized block fragment.
*/
public function __construct($block_id, $module, $delta) {
$this->blockId = $block_id;
$this->module = $module;
$this->delta = $delta;
}
/**
* {@inheritdoc}
*/
public function load($keys, $context) {
$block = block_load($this->module, $this->delta);
if (!$block) {
throw new AuthcacheP13nRequestNotFound();
}
return array(
$this->blockId => $block,
);
}
/**
* {@inheritdoc}
*/
public function render($block_id, $block, $context) {
$build = _block_get_renderable_array(_block_render_blocks(array(
$block_id => $block,
)));
return render($build);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AuthcacheBlockFragment:: |
protected | property | ||
AuthcacheBlockFragment:: |
protected | property | ||
AuthcacheBlockFragment:: |
protected | property | ||
AuthcacheBlockFragment:: |
public | function |
Load the objects designated by the given list of keys. Overrides AuthcacheP13nFragmentLoaderInterface:: |
|
AuthcacheBlockFragment:: |
public | function |
Render and return fragment. Overrides AuthcacheP13nFragmentInterface:: |
|
AuthcacheBlockFragment:: |
public | function | Construct new personalized block fragment. |