Unknown Entity namespace alias 'PirastruFormBuilderBundle'

随声附和 提交于 2019-12-11 07:31:19

问题


It has been now 2 days that i'm looking for a solution to this error but in vain :

Unknown Entity namespace alias 'PirastruFormBuilderBundle'

in fact i installed the sonata form builder with sonata page bundle using the composer but i don't know why i'm getting this error.

i don't know which part of codes should i copie here so please don't hesitate to ask me for it

sonata_form_builder:
    resource: '@PirastruFormBuilderBundle/Controller/FormBuilderController.php'
    type:  annotation

Thanks !!

EDIT

when i run this : php app/console config:dump-reference

PirastruFormBuilderBundle | pirastru_form_builder |

and when i run this : php app/console doctrine:mapping:info i got

[Exception] You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or mapping files you should check your mapping configuration for errors.

well i managed to solve the problem ! i had just to add a getManager in my FormBuilderBlockService


回答1:


This problem can be caused by some (mis)configurations :

Bundle

app/console config:dump-reference

This command let you know if the Bundle is referenced.

Mapping

app/console doctrine:mapping:info

This command let you know if the Bundle is mapped.

It's typically a mapping issue :

Unknown Entity namespace alias '***Bundle'

The better solution is to add auto_mapping to true in config.yml, like this :

orm:
    auto_generate_proxy_classes: "%kernel.debug%"
    auto_mapping: true

But it can be solved by others way, you can have a look to : Symfony : What is the meaning of auto_mapping and auto_generate_proxy_classes

Best regards,



来源:https://stackoverflow.com/questions/42947835/unknown-entity-namespace-alias-pirastruformbuilderbundle

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