我的生产服务器上只有一个奇怪的问题,映射似乎不正确。它在我的开发服务器上工作 - 它们都是最新的git。
这是我正在制作的错误:
[Doctrine\ORM\Mapping\MappingException]
The target-entity Shawmut\ClientBundle\Entity\NHPProductId cannot be found in 'Shawmut\ClientBundle\Entity\User#nhpProductIds'.
来自我的实体\ NHPProductId:
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="nhpProductIds")
* @ORM\JoinColumn(name="nhp_product_id_users", referencedColumnName="id")
**/
protected $user;
来自我的实体\用户:
/**
* @ORM\OneToMany(targetEntity="NHPProductId", mappedBy="user")
**/
protected $nhpProductIds;
有谁能想到这里出了什么问题?
编辑:我能够通过将我的实体重命名为 ProductId 而不是NHPProductId来解决这个问题。我不知道为什么这会导致实体无法加载,但这就是修复。
答案 0 :(得分:1)
这最终归因于我的实体名称。通过将其重命名为NhpProductId,问题就消失了。