grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026setDefined('fields') ->setAllowedTypes('fields', 'array') ->setAllowedValues('fields', $this->validatorFactory->createClosureForIterator([ new Assert\NotBlank(), new Assert\Regex([ 'pattern' => self::REGEX_FIELD_PATTERN, 'match' => false, ]), ], true)) ->setNormalizer('fields', function (Options $options, $values) { $bean = $this->beanManager->newBeanSafe(key($values)); $attributes = $bean->toArray(); $fields = explode(',', array_shift($values)); $invalidFields = array_filter($fields, function ($field) use ($attributes) { return !array_key_exists($field, $attributes); }); if ($invalidFields) { throw new \InvalidArgumentException( sprintf( 'The following field%s in %s module %s not found: %s', count($invalidFields) > 1 ? 's' : '', $bean->getObjectName(), count($invalidFields) > 1 ? 'are' : 'is', implode(', ', $invalidFields) ) ); } return $fields; }); } }