-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
FeatureGood first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)Validator
Description
Let's say we have a bloger which can assign from one to five tags to his blog. While submiting the server should count tags and check whether the collection in the allowed range. It can be done with Choice
validator and min
and max
options. But in this case we have such problems:
- It should fetch all tags from db to check that choices are valid,
- Very hard to define callback in case of using
$repository->findAll()
From another side we have Min\Max
and MinLength\MaxLength
validators but they very restrictive (the first takes only integers and second one only strings)
So I am thinking of moving count validation rules from Choice to a new validators called MinCount
and MaxCount
BTW I can do a PR if you find it useful.
Metadata
Metadata
Assignees
Labels
FeatureGood first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)Validator