public function FieldFormatterEntityEmbedDisplayBase::getFieldFormatter in Entity Embed 8
Constructs a field formatter.
Return value
\Drupal\Core\Field\FormatterInterface The formatter object.
1 call to FieldFormatterEntityEmbedDisplayBase::getFieldFormatter()
- FieldFormatterEntityEmbedDisplayBase::build in src/
EntityEmbedDisplay/ FieldFormatterEntityEmbedDisplayBase.php - Builds the renderable array for this Entity Embed display plugin.
1 method overrides FieldFormatterEntityEmbedDisplayBase::getFieldFormatter()
- ViewModeFieldFormatter::getFieldFormatter in src/
Plugin/ entity_embed/ EntityEmbedDisplay/ ViewModeFieldFormatter.php - Constructs a field formatter.
File
- src/
EntityEmbedDisplay/ FieldFormatterEntityEmbedDisplayBase.php, line 199
Class
- FieldFormatterEntityEmbedDisplayBase
- Base class for field formatter display plugins.
Namespace
Drupal\entity_embed\EntityEmbedDisplayCode
public function getFieldFormatter() {
if (!isset($this->fieldFormatter)) {
$display = [
'type' => $this
->getFieldFormatterId(),
'settings' => $this
->getConfiguration(),
'label' => 'hidden',
];
// Create the formatter plugin. Will use the default formatter for that
// field type if none is passed.
$this->fieldFormatter = $this->formatterPluginManager
->getInstance([
'field_definition' => $this
->getFieldDefinition(),
'view_mode' => '_entity_embed',
'configuration' => $display,
]);
}
return $this->fieldFormatter;
}