Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractNormalizer.php

function AbstractNormalizer::__construct

Sets the {@link ClassMetadataFactoryInterface} to use.

2 calls to AbstractNormalizer::__construct()
AbstractObjectNormalizer::__construct in vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php
Sets the {@link ClassMetadataFactoryInterface} to use.
AbstractObjectNormalizer::__construct in vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php
Sets the {@link ClassMetadataFactoryInterface} to use.
1 method overrides AbstractNormalizer::__construct()
AbstractObjectNormalizer::__construct in vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php
Sets the {@link ClassMetadataFactoryInterface} to use.

File

vendor/symfony/serializer/Normalizer/AbstractNormalizer.php, line 146

Class

AbstractNormalizer
Normalizer implementation.

Namespace

Symfony\Component\Serializer\Normalizer

Code

public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory = null, ?NameConverterInterface $nameConverter = null, array $defaultContext = []) {
    $this->defaultContext = array_merge($this->defaultContext, $defaultContext);
    $this->validateCallbackContext($this->defaultContext, 'default');
    if (isset($this->defaultContext[self::CIRCULAR_REFERENCE_HANDLER]) && !\is_callable($this->defaultContext[self::CIRCULAR_REFERENCE_HANDLER])) {
        throw new InvalidArgumentException(\sprintf('Invalid callback found in the "%s" default context option.', self::CIRCULAR_REFERENCE_HANDLER));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal