$this->pluginManager = \Drupal::
service('plugin.manager.field.formatter'
);
parent::
__construct($values,
$entity_type);
} /**
* {@inheritdoc}
*/
public function postSave(EntityStorageInterface
$storage,
$update = TRUE
) { // Reset the render cache for the target entity type.
parent::
postSave($storage,
$update);
if (\Drupal::
entityTypeManager()->
hasHandler($this->targetEntityType, 'view_builder'
)) { \Drupal::
entityTypeManager()->
getViewBuilder($this->targetEntityType
)->
resetCache();
} } /**
* {@inheritdoc}
*/
public function getRenderer($field_name) { if (isset($this->plugins
[$field_name])) { return $this->plugins
[$field_name];
}