public function EntityReferenceNormalizer::__construct in Commerce Cart API 8
Constructs a new EntityReferenceNormalizer object.
Parameters
\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository.
\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.
array $commerce_cart_api: The Cart API's service parameters.
Overrides EntityReferenceFieldItemNormalizer::__construct
File
- src/
Normalizer/ EntityReferenceNormalizer.php, line 39
Class
- EntityReferenceNormalizer
- Expands entity reference field values to their referenced entity.
Namespace
Drupal\commerce_cart_api\NormalizerCode
public function __construct(EntityRepositoryInterface $entity_repository, RouteMatchInterface $route_match, array $commerce_cart_api) {
parent::__construct($entity_repository);
$this->routeMatch = $route_match;
$this->allowedFields = $commerce_cart_api['normalized_entity_references'];
}