class FilterTestCacheMerge in Drupal 10
Same name and namespace in other branches
- 8 core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestCacheMerge.php \Drupal\filter_test\Plugin\Filter\FilterTestCacheMerge
- 9 core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestCacheMerge.php \Drupal\filter_test\Plugin\Filter\FilterTestCacheMerge
Provides a test filter to merge with CacheableMetadata.
Plugin annotation
@Filter(
id = "filter_test_cache_merge",
title = @Translation("Testing filter"),
description = @Translation("Does not change content; merges cacheable metadata."),
type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\filter\Plugin\FilterBase implements FilterInterface
- class \Drupal\filter_test\Plugin\Filter\FilterTestCacheMerge
- class \Drupal\filter\Plugin\FilterBase implements FilterInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of FilterTestCacheMerge
File
- core/
modules/ filter/ tests/ filter_test/ src/ Plugin/ Filter/ FilterTestCacheMerge.php, line 19
Namespace
Drupal\filter_test\Plugin\FilterView source
class FilterTestCacheMerge extends FilterBase {
/**
* {@inheritdoc}
*/
public function process($text, $langcode) {
$result = new FilterProcessResult($text);
$metadata = new CacheableMetadata();
$metadata
->addCacheTags([
'merge:tag',
]);
$metadata
->addCacheContexts([
'user.permissions',
]);
$result = $result
->merge($metadata);
return $result;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
FilterBase:: |
public | property | The name of the provider that owns this filter. | |
FilterBase:: |
public | property | An associative array containing the configured settings of this filter. | |
FilterBase:: |
public | property | A Boolean indicating whether this filter is enabled. | |
FilterBase:: |
public | property | The weight of this filter compared to others in a filter collection. | |
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | 1 | |
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterBase:: |
public | function | ||
FilterInterface:: |
constant | HTML tag and attribute restricting filters to prevent XSS attacks. | ||
FilterInterface:: |
constant | Non-HTML markup language filters that generate HTML. | ||
FilterInterface:: |
constant | Irreversible transformation filters. | ||
FilterInterface:: |
constant | Reversible transformation filters. | ||
FilterTestCacheMerge:: |
public | function |
Performs the filter processing. Overrides FilterInterface:: |
|
MessengerTrait:: |
protected | property | The messenger. | 18 |
MessengerTrait:: |
public | function | Gets the messenger. | 18 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function | ||
PluginBase:: |
public | function | ||
PluginBase:: |
public | function | 2 | |
PluginBase:: |
public | function | ||
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 3 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 1 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |