function EntityNormalizer::__construct

Same name in other branches
  1. 8.9.x core/modules/serialization/src/Normalizer/EntityNormalizer.php \Drupal\serialization\Normalizer\EntityNormalizer::__construct()
  2. 10 core/modules/serialization/src/Normalizer/EntityNormalizer.php \Drupal\serialization\Normalizer\EntityNormalizer::__construct()
  3. 11.x core/modules/serialization/src/Normalizer/EntityNormalizer.php \Drupal\serialization\Normalizer\EntityNormalizer::__construct()

Constructs an EntityNormalizer object.

Parameters

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

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

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

File

core/modules/serialization/src/Normalizer/EntityNormalizer.php, line 34

Class

EntityNormalizer
Normalizes/denormalizes Drupal entity objects into an array structure.

Namespace

Drupal\serialization\Normalizer

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityTypeRepositoryInterface $entity_type_repository, EntityFieldManagerInterface $entity_field_manager) {
    $this->entityTypeManager = $entity_type_manager;
    $this->entityTypeRepository = $entity_type_repository;
    $this->entityFieldManager = $entity_field_manager;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.