You are here

public function ParagraphBlocksDeriver::__construct in Paragraph blocks 8.2

Same name and namespace in other branches
  1. 3.x src/Plugin/Deriver/ParagraphBlocksDeriver.php \Drupal\paragraph_blocks\Plugin\Deriver\ParagraphBlocksDeriver::__construct()

Constructs new EntityViewDeriver.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager.

\Drupal\Core\Entity\EntityTypeRepositoryInterface $entity_type_repository: The entity type repository.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

Overrides EntityDeriverBase::__construct

File

src/Plugin/Deriver/ParagraphBlocksDeriver.php, line 34

Class

ParagraphBlocksDeriver
Provides entity field block definitions for every field.

Namespace

Drupal\paragraph_blocks\Plugin\Deriver

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, TranslationInterface $string_translation, EntityFieldManagerInterface $entity_field_manager, EntityTypeRepositoryInterface $entity_type_repository, ConfigFactoryInterface $config_factory) {
  $this->entityTypeManager = $entity_type_manager;
  $this->stringTranslation = $string_translation;
  $this->entityFieldManager = $entity_field_manager;
  $this->entityTypeRepository = $entity_type_repository;
  $this->maxCardinality = $config_factory
    ->get('paragraph_blocks.settings')
    ->get('max_cardinality') ?: 10;
}