class FieldMappingProcessor in Gutenberg 8.2
Processor removing blocks with a "mappingFields" attribute.
Hierarchy
- class \Drupal\gutenberg\BlockProcessor\FieldMappingProcessor implements GutenbergBlockProcessorInterface
Expanded class hierarchy of FieldMappingProcessor
1 string reference to 'FieldMappingProcessor'
1 service uses FieldMappingProcessor
File
- src/
BlockProcessor/ FieldMappingProcessor.php, line 10
Namespace
Drupal\gutenberg\BlockProcessorView source
class FieldMappingProcessor implements GutenbergBlockProcessorInterface {
/**
* {@inheritdoc}
*/
public function processBlock(array &$block, &$block_content, RefinableCacheableDependencyInterface $bubbleable_metadata) {
// Remove the inner content since the contents of this block will be mapped
// to an entity field.
$block_content = '';
// Stop further processing by returning FALSE?
// Shouldn't have to if it's of a low enough weight.
}
/**
* {@inheritdoc}
*/
public function isSupported(array $block, $block_content = '') {
return !empty($block['attrs']['mappingFields']) && is_array($block['attrs']['mappingFields']);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldMappingProcessor:: |
public | function |
Whether the processor supports this block instance. Overrides GutenbergBlockProcessorInterface:: |
|
FieldMappingProcessor:: |
public | function |
Process the Gutenberg block and its content. Overrides GutenbergBlockProcessorInterface:: |