EntityAudit-Doctrine2:可能在OneToMany和OneToOne中使用相同的实体


EntityAudit - Doctrine2: Using the same entity in both OneToMany and OneToOne possible

是否可以使用simplethings/EntityAudit对实体进行审计-https://github.com/simplethings/EntityAudit

在OneToMany和OneToOne关系中使用相同的实体?

类地址{/***@ORM''列*/受保护的$address_text;/***@ORM''ManyToOne(targetEntity="Customer",invertedBy="addresses")*/受保护的$customer;}类别客户{/***@ORM''OneToMany(targetEntity="地址",mappedBy="客户")*/受保护的$地址;/***@ORM''OneToOne(targetEntity="地址")*/受保护的$primary_address;}

如果不进行审核,它可以完美地工作,但有了它,脚本就结束了带有"未识别索引"通知的UnitOfWork::getEntityIdentifier

  • 上也有描述https://github.com/simplethings/EntityAudit/issues/9

  • 从OneToMany和OneToOne中使用相同实体借用的测试用例可能吗?

  1. 我已经从https://github.com/merk/EntityAudit/commit/0c1c7df1e53d50629c141b418a18ccee83a3b9b4,还有一个PR,也许它很快就会在官方回购中得到解决(merk/onetomany分行)。

  2. 还要确保你的实体名称在config.yml中写得正确(大写/小写),如果错误,似乎没有错误