You are here

public function ClassMetadata::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Mapping/ClassMetadata.php \Symfony\Component\Validator\Mapping\ClassMetadata::__construct()
  2. 8 vendor/symfony/serializer/Mapping/ClassMetadata.php \Symfony\Component\Serializer\Mapping\ClassMetadata::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Mapping/ClassMetadata.php \Symfony\Component\Validator\Mapping\ClassMetadata::__construct()

Constructs a metadata for the given class.

Parameters

string $class:

Overrides ElementMetadata::__construct

File

vendor/symfony/validator/Mapping/ClassMetadata.php, line 118

Class

ClassMetadata
Default implementation of {@link ClassMetadataInterface}.

Namespace

Symfony\Component\Validator\Mapping

Code

public function __construct($class) {
  $this->name = $class;

  // class name without namespace
  if (false !== ($nsSep = strrpos($class, '\\'))) {
    $this->defaultGroup = substr($class, $nsSep + 1);
  }
  else {
    $this->defaultGroup = $class;
  }
}