Skip to content

Instantly share code, notes, and snippets.

@Raistlfiren
Created January 20, 2016 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raistlfiren/214392d6eb9e788399c9 to your computer and use it in GitHub Desktop.
Save Raistlfiren/214392d6eb9e788399c9 to your computer and use it in GitHub Desktop.
<?php
//Entity file
* @UniqueEntity(fields="email", message="Sorry, this email address is already in use.", groups={"registration"})
//Form file
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'FA\BackEnd\UserBundle\Entity\User',
'validation_groups' => ['registration']
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment