Reputation: 448
I have a strange problem only on my production server where the mapping appears to be incorrect. It's working on my development server -- they are both up to date on git.
This is the error I'm getting on production:
[Doctrine\ORM\Mapping\MappingException]
The target-entity Shawmut\ClientBundle\Entity\NHPProductId cannot be found in 'Shawmut\ClientBundle\Entity\User#nhpProductIds'.
From my Entity\NHPProductId:
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="nhpProductIds")
* @ORM\JoinColumn(name="nhp_product_id_users", referencedColumnName="id")
**/
protected $user;
From my Entity\User:
/**
* @ORM\OneToMany(targetEntity="NHPProductId", mappedBy="user")
**/
protected $nhpProductIds;
Can anyone think of what is going wrong here?
EDIT: I was able to solve this by renaming my entity to ProductId instead of NHPProductId. I have no idea why this was causing the Entity to not be loaded, but that was the fix.
Upvotes: 2
Views: 3554
Reputation: 448
This ended up being due to my entity's name. By renaming it to NhpProductId, the problem went away.
Upvotes: 1