class views_content_cache_key_votingapi in Views content cache 7.3
Same name and namespace in other branches
- 6.2 plugins/votingapi.inc \views_content_cache_key_votingapi
@file Provides the Views content cache votingapi plugin.
Hierarchy
- class \views_content_cache_key
Expanded class hierarchy of views_content_cache_key_votingapi
1 string reference to 'views_content_cache_key_votingapi'
- views_content_cache_views_content_cache_plugins in ./
views_content_cache.module - Implements hook_views_content_cache_plugins().
File
- plugins/
views_content_cache/ votingapi.inc, line 7 - Provides the Views content cache votingapi plugin.
View source
class views_content_cache_key_votingapi extends views_content_cache_key {
function options_form($value, &$handler = NULL) {
// Get all of the possible tags that we could monitor:
$metadata = votingapi_metadata();
$options = array();
foreach ($metadata['tags'] as $tag => $data) {
$options['tag:' . $tag] = t('Tag: @name', array(
'@name' => $data['name'],
));
}
foreach ($metadata['functions'] as $function => $data) {
$options['function:' . $function] = t('Function: @name', array(
'@name' => $data['name'],
));
}
return array(
'#title' => t('Voting API'),
'#description' => t('Checks for updates to votes'),
'#type' => 'checkboxes',
'#options' => $options,
'#default_value' => $value,
);
}
function content_key($object, $object_type) {
$keys = array();
if ($object_type === 'votingapi_results') {
foreach ($object as $result) {
$keys[] = 'tag:' . $result['tag'];
$keys[] = 'function:' . $result['function'];
}
}
return $keys;
}
function clause_mode() {
// We can't be combined with other cache segments:
return 'OR';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_content_cache_key:: |
function | Handy helper method that scans the given view looking for arguments. | ||
views_content_cache_key:: |
function | An array of keys to check in this cache segment when viewing the view. | 1 | |
views_content_cache_key:: |
function | Returns an array of views arguments that can supply valid key values. | 2 | |
views_content_cache_key:: |
function | Replaces values corresponding to argument values set dynamically. | ||
views_content_cache_key_votingapi:: |
function |
The method by which this plugin's where clause will be combined with others. Overrides views_content_cache_key:: |
||
views_content_cache_key_votingapi:: |
function |
Builds an array of keys for the cache segment. Overrides views_content_cache_key:: |
||
views_content_cache_key_votingapi:: |
function |
Optionally provides a option form for the user to use this segment. Overrides views_content_cache_key:: |