You are here

public function Field::__construct in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/Field.php \Drupal\views\Plugin\views\field\Field::__construct()

Constructs a \Drupal\field\Plugin\views\field\Field object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The field formatter plugin manager.

\Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager: The field formatter plugin manager.

\Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_plugin_manager: The field plugin type manager.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

Overrides HandlerBase::__construct

File

core/modules/views/src/Plugin/views/field/Field.php, line 141
Contains \Drupal\views\Plugin\views\field\Field.

Class

Field
A field that displays entity field data.

Namespace

Drupal\views\Plugin\views\field

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, FormatterPluginManager $formatter_plugin_manager, FieldTypePluginManagerInterface $field_type_plugin_manager, LanguageManagerInterface $language_manager, RendererInterface $renderer) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->entityManager = $entity_manager;
  $this->formatterPluginManager = $formatter_plugin_manager;
  $this->fieldTypePluginManager = $field_type_plugin_manager;
  $this->languageManager = $language_manager;
  $this->renderer = $renderer;

  // @todo Unify 'entity field'/'field_name' instead of converting back and
  //   forth. https://www.drupal.org/node/2410779
  if (isset($this->definition['entity field'])) {
    $this->definition['field_name'] = $this->definition['entity field'];
  }
}