I am following the book and on the page http://symfony.com/doc/current/book/doctrine.html
While following the book I am trying to work on relationship of product and cat
One of the two things may be the problem,
make sure you have a use statement at the top, that is
use Acme\StoreBundle\Entity\Product;
It is not included in the example, they only displayed
use Doctrine\Common\Collections\ArrayCollection;
When specifying target entity always specify full namespace if the entities are in different name spaces. example:
@ORM\OneToMany(targetEntity="Acme\StoreBundle\Entity\Product", mappedBy="category")
instead of:
@ORM\OneToMany(targetEntity="Product", mappedBy="category")
The second one only works if the two entities are in same namespace and that entity has been called by use
statement above the class.