Fixing Symfony Error with Bi-directional relationships
<p>I keep getting this error: </p>

<blockquote>
  <p>The field MySite\ProductBundle\Entity\Product#photo is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity MySite\PhotoBundle\Entity\Photo#product does not contain the required 'inversedBy=photo' attribute.</p>
</blockquote>

<p>I've tried swapping and adding inversedBy and mappedBy on both sides but I cannot get rid of this error. I've tried adding the suggested code as given in the debugger, doesn't work. Here are my mappings: </p>

<p><strong>Product.php</strong></p>

<pre><code>/**
 * @ORM\OneToMany(targetEntity="MySite\PhotoBundle\Entity\Photo", mappedBy="product", cascade={"remove"})
 */
protected $photo;
</code></pre>

<p><strong>Photo.php</strong></p>

<pre><code>/**
 * @ORM\ManyToOne(targetEntity="MySite\ProductBundle\Entity\Product")
 * @ORM\JoinColumn(name="product_id", referencedColumnName="id", nullable=true)
 */
protected $product;
</code></pre>

<p>Not sure what to do. </p>

<p>Thanks.</p>