public function CommentDefaultFormatter::__construct in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php \Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter::__construct()
Constructs a new CommentDefaultFormatter.
Parameters
string $plugin_id: The plugin_id for the formatter.
mixed $plugin_definition: The plugin implementation definition.
\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the formatter is associated.
array $settings: The formatter settings.
string $label: The formatter label display setting.
string $view_mode: The view mode.
array $third_party_settings: Third party settings.
\Drupal\Core\Session\AccountInterface $current_user: The current user.
\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager
\Drupal\Core\Entity\EntityFormBuilderInterface $entity_form_builder: The entity form builder.
Overrides FormatterBase::__construct
File
- core/
modules/ comment/ src/ Plugin/ Field/ FieldFormatter/ CommentDefaultFormatter.php, line 124 - Contains \Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter.
Class
- CommentDefaultFormatter
- Provides a default comment formatter.
Namespace
Drupal\comment\Plugin\Field\FieldFormatterCode
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, EntityManagerInterface $entity_manager, EntityFormBuilderInterface $entity_form_builder) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
$this->viewBuilder = $entity_manager
->getViewBuilder('comment');
$this->storage = $entity_manager
->getStorage('comment');
$this->currentUser = $current_user;
$this->entityManager = $entity_manager;
$this->entityFormBuilder = $entity_form_builder;
}