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

后端 未结 2 2012
囚心锁ツ
囚心锁ツ 2021-02-10 01:44

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

class User 
{
    protected $inputFilter;

    public function getInputFilter()
    {
                


        
2条回答
  •  攒了一身酷
    2021-02-10 02:16

    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.' 
            ),
        ),
    

    ),

提交回复
热议问题