Reputation: 111
is it possible do audit entities with the simplethings / EntityAudit - https://github.com/simplethings/EntityAudit
using the same entity in both OneToMany and OneToOne relation?
class Address { /** * @ORM\Column */ protected $address_text; /** * @ORM\ManyToOne(targetEntity="Customer", inversedBy="addresses") */ protected $customer; } class Customer { /** * @ORM\OneToMany(targetEntity="Address", mappedBy="customer") */ protected $addresses; /** * @ORM\OneToOne(targetEntity="Address") */ protected $primary_address; }
without auditing it works perfectly, but with it - the script ends on
UnitOfWork::getEntityIdentifier
with the "Unidentified index" notice
described as well on https://github.com/simplethings/EntityAudit/issues/9
test case borrowed from Using the same entity in both OneToMany and OneToOne possible?
Upvotes: 1
Views: 849
Reputation: 5856
I've pulled in the changes from https://github.com/merk/EntityAudit/commit/0c1c7df1e53d50629c141b418a18ccee83a3b9b4 , there is also a PR, maybe it's getting fixed in official repo soon ( merk/onetomany branch ).
Make also sure your Entity name is written right (Upper/Lowecase) in config.yml, there seems to be no error if its wrong
Upvotes: 1