一对一与对多

order 表中

/**
* @ORMOneToOne(targetEntity="SnatchTreasure")
*/
private $snatchTreasure;



在snatchTreasure表中有

/**
* @ORMOneToOne(targetEntity="OrderRecord", mappedBy="snatchTreasure")//注意这两处书写要一致才能从父表读到子表数据
*/
private $orderRecord;

  

原文地址:https://www.cnblogs.com/wlemory/p/5440161.html