You are here

public function PropertyMetadata::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Mapping/PropertyMetadata.php \Symfony\Component\Validator\Mapping\PropertyMetadata::__construct()

Constructor.

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 39

Class

PropertyMetadata
Stores all metadata needed for validating a class property.

Namespace

Symfony\Component\Validator\Mapping

Code

public function __construct($class, $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);
}