Unique Constraint return type mismatch Unique Constraint return type mismatch symfony symfony

Unique Constraint return type mismatch


The Unique constraint is meant for collections (meaning: a field, that holds a collection), and determines, if all entries are unique.

What you probably want:

The UniqueEntity constraint - it must be set on the entity, not the fields, but you can set it twice and once for each field, and set its fields property to the appropriate field respectively.