private function YamlFileLoader::loadClassMetadataFromYaml in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php \Symfony\Component\Validator\Mapping\Loader\YamlFileLoader::loadClassMetadataFromYaml()
Loads the validation metadata from the given YAML class description.
Parameters
ClassMetadata $metadata The metadata to load:
array $classDescription The YAML class description:
1 call to YamlFileLoader::loadClassMetadataFromYaml()
- YamlFileLoader::loadClassMetadata in vendor/
symfony/ validator/ Mapping/ Loader/ YamlFileLoader.php - Loads validation metadata into a {@link ClassMetadata} instance.
File
- vendor/
symfony/ validator/ Mapping/ Loader/ YamlFileLoader.php, line 146
Class
- YamlFileLoader
- Loads validation metadata from a YAML file.
Namespace
Symfony\Component\Validator\Mapping\LoaderCode
private function loadClassMetadataFromYaml(ClassMetadata $metadata, array $classDescription) {
if (isset($classDescription['group_sequence_provider'])) {
$metadata
->setGroupSequenceProvider((bool) $classDescription['group_sequence_provider']);
}
if (isset($classDescription['group_sequence'])) {
$metadata
->setGroupSequence($classDescription['group_sequence']);
}
if (isset($classDescription['constraints']) && is_array($classDescription['constraints'])) {
foreach ($this
->parseNodes($classDescription['constraints']) as $constraint) {
$metadata
->addConstraint($constraint);
}
}
if (isset($classDescription['properties']) && is_array($classDescription['properties'])) {
foreach ($classDescription['properties'] as $property => $constraints) {
if (null !== $constraints) {
foreach ($this
->parseNodes($constraints) as $constraint) {
$metadata
->addPropertyConstraint($property, $constraint);
}
}
}
}
if (isset($classDescription['getters']) && is_array($classDescription['getters'])) {
foreach ($classDescription['getters'] as $getter => $constraints) {
if (null !== $constraints) {
foreach ($this
->parseNodes($constraints) as $constraint) {
$metadata
->addGetterConstraint($getter, $constraint);
}
}
}
}
}