I'm building a form in ZF2 from an entity and everything seems to work fine, except 2 of my validators are ignored for some reason. The Entity looks like this:
/**
* @var string $name
*
* @ORM\Column(name="name", type="string", length=255, nullable=true)
* @Annotation\Attributes({"type":"text"})
* @Annotation\Validator({"name":"NotEmpty"}) // duplicate
* @Annotation\Options({"label":"Name:"})
*/
private $name;
/**
* @var integer $sort
*
* @ORM\Column(name="sort", type="integer")
* @Annotation\Attributes({"type":"text"})
* @Annotation\Validator({"name":"Int"})
* @Annotation\Validator({"name":"NotEmpty"})
* @Annotation\Options({"label":"Sort:"})
*/
private $sort;
Yet I can submit the form without any values. I can enter a string in the SORT input, I can leave both fields empty. Why is this not working, why is there no errormessage when I leave the fields empty?