Sonata and Gedmo\\References doctrine extension doesn't work ( Class does not exist )

人盡茶涼 提交于 2019-12-08 12:55:32

I ran into the same issue @ArFeRR. My solution was to use the 'entity' type and add the related class name for the form field:

    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
//            ->add('branch', 'sonata_type_model', array( // Unknown Document namespace alias 'PlusquamContractBundle'.
            ->add('branch', 'entity', array(
                'class'    => 'PlusquamContractBundle:Branch',
                'by_reference' => false
            ))
        ;
    }

This will make the "Class does not exist" error disappear.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!