sonata-project / EntityAuditBundle

Audit for Doctrine Entities
https://sonata-project.org
MIT License
633 stars 261 forks source link

allow ManyToMany associations with referenced column name different from 'id' #631

Open awm1 opened 4 months ago

awm1 commented 4 months ago

Subject

I've found out that if I want to audit entity with ID column with name different from 'id' :

class User { /**

...those ManyToMany assoc isn't referred by its correct identifier name, but static 'id' string which will throw Exception. So I try to get it from available source, however I'm not sure if this is the right way to obtain it. I am targeting 1.x branch because this is simple fix which should not break anything.

Changelog

### Fixed
Accessing ManyToMany associations of audited entity with identity field of name different from 'id'.