Skip to content

Instantly share code, notes, and snippets.

@nicosomb
Created March 13, 2015 20:57
Show Gist options
  • Save nicosomb/c6aa3c5c5507b9bfc0cf to your computer and use it in GitHub Desktop.
Save nicosomb/c6aa3c5c5507b9bfc0cf to your computer and use it in GitHub Desktop.
<?php
/**
* @UniqueEntity(fields={"login"}, groups={"registration"}, message="login already taken")
*/
class Account {
/**
* @var string
*
* @ORM\Column(name="login", type="string", length=255, nullable=false, unique=true)
* @Assert\NotBlank()
*/
private $login;
}
<?php
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Account',
'validation_groups' => array('registration'),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment