Syntax // src/Entity/Person.php namespace App\Entity; use Symfony\Component\Validator\Constraints as Assert; class Person { /** * @Assert\Unique(message="The value email is repeated.") */ protected $contactEmails; }