The target-entity cannot be found in - MappingException

前端 未结 2 763
情歌与酒
情歌与酒 2020-12-10 09:34

I have Symfony project, in which there are 2 entities - Building and Building_type. They are connected with ManyToMany uni-directional association. So, when I try to access

相关标签:
2条回答
  • 2020-12-10 09:45

    Because the name of the entity contains an underscore _ and the PSR-0 autoloader will try to find it in Farpost/StoreBundle/Entity/Building/type.php.

    You need to rename your class to BuildingType and put it in Farpost/StoreBundle/Entity/BuildingType.php

    0 讨论(0)
  • 2020-12-10 09:59

    Also, make sure that your composer.json has proper entries pointing to proper namespace. Mine did not, causing this error.

    0 讨论(0)
提交回复
热议问题