Entity exist validation in Zend Framework 2 with Doctrine 2 using inputfilter in entity

后端 未结 2 522
南笙
南笙 2021-02-10 01:37

I have been building my all validation in Entity class like this...

class User 
{
    protected $inputFilter;

    public function getInputFilter()
    {
                


        
2条回答
  •  佛祖请我去吃肉
    2021-02-10 01:57

    Have you tried adding the full namespace to the Validator?

    array(
        'name' =>'\Auth\Validator\Doctrine\NoEntityExists', 
        'options' => array(
            'messages' => array(
               \Zend\Validator\NotEmpty::IS_EMPTY => 'User name can not be empty.' 
            ),
        ),
    

    ),

提交回复
热议问题