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

Breadcrumb

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

function PropertyMetadata::__construct

Parameters

string $class The class this property is defined on:

string $name The name of this property:

Throws

ValidatorException

Overrides MemberMetadata::__construct

File

vendor/symfony/validator/Mapping/PropertyMetadata.php, line 37

Class

PropertyMetadata
Stores all metadata needed for validating a class property.

Namespace

Symfony\Component\Validator\Mapping

Code

public function __construct(string $class, string $name) {
    if (!property_exists($class, $name)) {
        throw new ValidatorException(\sprintf('Property "%s" does not exist in class "%s".', $name, $class));
    }
    parent::__construct($class, $name, $name);
}

API Navigation

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