ApiPlatform\Core\Bridge\Symfony\Validator\Metadata\Property\ValidatorPropertyMetadataFactory::isRequiredByGroups PHP Метод

isRequiredByGroups() приватный Метод

Tests if the property is required because of its validation groups.
private isRequiredByGroups ( Symfony\Component\Validator\Mapping\PropertyMetadataInterface $validatorPropertyMetadata, array $options ) : boolean
$validatorPropertyMetadata Symfony\Component\Validator\Mapping\PropertyMetadataInterface
$options array
Результат boolean
    private function isRequiredByGroups(ValidatorPropertyMetadataInterface $validatorPropertyMetadata, array $options) : bool
    {
        foreach ($options['validation_groups'] as $validationGroup) {
            if (!is_string($validationGroup)) {
                continue;
            }
            foreach ($validatorPropertyMetadata->findConstraints($validationGroup) as $constraint) {
                if ($this->isRequired($constraint)) {
                    return true;
                }
            }
        }
        return false;
    }