Constructs a FormatterBase object.
string $plugin_id: The plugin_id for the formatter.
array $plugin_definition: The plugin implementation definition.
\Drupal\field\Plugin\Core\Entity\FieldInstance $instance: The field instance to which the formatter is associated.
array $settings: The formatter settings.
string $label: The formatter label display setting.
string $view_mode: The view mode.
Overrides PluginBase::__construct
public function __construct($plugin_id, array $plugin_definition, $instance, array $settings, $label, $view_mode) {
parent::__construct(array(), $plugin_id, $plugin_definition);
$this->instance = $instance;
$this->field = field_info_field($instance['field_name']);
$this->settings = $settings;
$this->label = $label;
$this->viewMode = $view_mode;
}