function Cascade::__construct
Parameters
non-empty-string[]|non-empty-string|array<string,mixed>|null $exclude Properties excluded from validation:
array<string,mixed>|null $options:
Overrides Constraint::__construct
File
-
vendor/
symfony/ validator/ Constraints/ Cascade.php, line 31
Class
- Cascade
- Validates a whole class, including nested objects in properties.
Namespace
Symfony\Component\Validator\ConstraintsCode
public function __construct(array|string|null $exclude = null, ?array $options = null) {
if (\is_array($exclude) && !array_is_list($exclude)) {
$options = array_merge($exclude, $options ?? []);
}
else {
$this->exclude = array_flip((array) $exclude);
}
if (\is_array($options) && \array_key_exists('groups', $options)) {
throw new ConstraintDefinitionException(\sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__));
}
parent::__construct($options);
}