We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee9b2c4 commit 64e6e3bCopy full SHA for 64e6e3b
reference/constraints/UniqueEntity.rst
@@ -110,19 +110,18 @@ between all of the rows in your user table:
110
// DON'T forget the following use statement!!!
111
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
112
113
- use Symfony\Component\Validator\Constraints as Assert;
114
-
115
class UserType extends AbstractType
116
{
117
// ...
118
119
public function configureOptions(OptionsResolver $resolver): void
120
121
$resolver->setDefaults([
+ // ...
122
'data_class' => User::class,
123
'constraints' => [
124
new UniqueEntity(fields: ['email']),
125
- ]
+ ],
126
]);
127
}
128
0 commit comments