I have a class like this:
class Student {
const GENDER_MALE = \"male\", GENDER_FEMALE = \"female\";
/**
* @var string $gender
*
* @ORM\\Column(name=\"gen
This is a feature of Doctrine2 Annotation Reader (Constants).
You solution:
class Student
{
const GENDER_MALE = "male", GENDER_FEMALE = "female";
/**
* @var string $gender
*
* @ORM\Column(name="gender", type="string", length=50,nullable=false)
* @Assert\NotBlank(message="Gender cannot be blank",groups={"new"})
* @Assert\Choice(
* choices = {
* Student::GENDER_FEMALE: "Female",
* Student::GENDER_MALE: "Male"
* },
* message = "Choose a valid gender.", groups={"new"}
* )
*/
private $gender;
}