Question

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.

Was it helpful?

Solution

This ended up being due to my entity's name. By renaming it to NhpProductId, the problem went away.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top