I have a table where two fields must be linked with Product entity. But Doctrine recognizes only one of them, processing second as usual integer.
I've read an almost similar question Doctrine2 Mapping: 2 fields mapped to one field (ManyToOne) but as far as I can see, my annotations must be correct.
Any ideas what am I doing wrong?
class ProductProduct:
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $id;
/**
* @ORM\Column(name="product_id", type="integer")
* @ORM\ManyToOne(targetEntity="Product", inversedBy="productProduct")
* @ORM\JoinColumn(name="product_id", referencedColumnName="id")
*/
private $product;
/**
* @ORM\Column(name="product_replace_id", type="integer")
* @ORM\ManyToOne(targetEntity="Product", inversedBy="productProductReplace")
* @ORM\JoinColumn(name="product_replace_id", referencedColumnName="id")
*/
private $productIdReplace;
class Product:
/**
* @ORM\OneToMany(targetEntity="ProductProduct", mappedBy="product")
**/
private $productProduct;
/**
* @ORM\OneToMany(targetEntity="ProductProduct", mappedBy="productIdReplace")
**/
private $productProductReplace;