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

Breadcrumb

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

function DiscriminatorMap::__construct

Parameters

string $typeProperty The property holding the type discriminator:

array<string, class-string> $mapping The mapping between types and classes (i.e. ['admin_user' => AdminUser::class]):

Throws

InvalidArgumentException

File

vendor/symfony/serializer/Attribute/DiscriminatorMap.php, line 28

Class

DiscriminatorMap
@author Samuel Roze <samuel.roze@gmail.com>

Namespace

Symfony\Component\Serializer\Attribute

Code

public function __construct(string $typeProperty, array $mapping) {
    if (!$typeProperty) {
        throw new InvalidArgumentException(\sprintf('Parameter "typeProperty" given to "%s" cannot be empty.', static::class));
    }
    if (!$mapping) {
        throw new InvalidArgumentException(\sprintf('Parameter "mapping" given to "%s" cannot be empty.', static::class));
    }
}

API Navigation

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