The target-entity cannot be found in - MappingException

前端 未结 2 779
情歌与酒
情歌与酒 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

提交回复
热议问题