我有三个实体Stock
,StockDetail
和CatalogHasStock
。这CatalogHasStock
是我的映射:
/**
* @ORM\ManyToOne(targetEntity="StockBundle\Entity\StockDetail")
* @ORM\JoinColumns(@ORM\JoinColumn(name="product", referencedColumnName="product"),
* @ORM\JoinColumn(name="company", referencedColumnName="company"),
* @ORM\JoinColumn(name="stock_detail", referencedColumnName="id"),
* @ORM\JoinColumn(name="upc", referencedColumnName="upc"),
* @ORM\JoinColumn(name="kcondition", referencedColumnName="kcondition"))
*/
protected $stock;
现在StockDetail
这是映射:
/**
* @ORM\ManyToOne(targetEntity="StockBundle\Entity\Stock", inversedBy="sdetails")
* @ORM\JoinColumns(@ORM\JoinColumn(name="product", referencedColumnName="product"),
* @ORM\JoinColumn(name="company", referencedColumnName="company"),
* @ORM\JoinColumn(name="kcondition", referencedColumnName="kcondition"))
*/
protected $stock;
我需要插入值CatalogHasStock
,我这样做:
$catalog_has_stock = new CatalogHasStock ();
$catalog_has_stock->setStock($entityStockDetail);
但我得到这个错误:
注意:未定义索引:/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php 行 685 中的产品
映射部分有什么问题?