Skip to content

Instantly share code, notes, and snippets.

@feyyazesat
Created August 26, 2015 10:32
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 feyyazesat/aa6674271ce5174041ba to your computer and use it in GitHub Desktop.
Save feyyazesat/aa6674271ce5174041ba to your computer and use it in GitHub Desktop.
validation annotation.
/**
* @var string
*
* @ORM\Column(name="firstname", type="string", length=45, nullable=true)
* @Assert\Length(
* min = 2,
* max = 45,
* minMessage = "user.form.validation.firstname.min",
* maxMessage = "user.form.validation.firstname.max",
* groups = {"personal_info"}
* )
* @Assert\NotBlank(
* message = "user.form.validation.firstname.blank",
* groups = {"personal_info"}
* )
* @Assert\Regex(
* pattern="/^[a-zA-ZàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð']+$/u",
* match=true,
* message="user.form.validation.firstname.regex",
* groups = {"personal_info"}
* )
*/
private $firstname;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment