EntityAuditBundle icon indicating copy to clipboard operation
EntityAuditBundle copied to clipboard

Ignore related tables for auditiong

Open dmitrach opened this issue 2 years ago • 3 comments

Feature Request

I would like to ignore a related table with M:M for auditing.

Actually it is not possible as I see and I cannot change the current library.

https://stackoverflow.com/questions/77801195/how-to-ignore-many-to-many-relationship-with-entityaudit-entityauditbundle?noredirect=1#comment137179292_77801195

<?php
/** @Entity **/
class User
{
    // ...

    /**
     * @ManyToMany(targetEntity="User", mappedBy="myFriends")
     **/
    private $friendsWithMe;

    /**
     * @ManyToMany(targetEntity="User", inversedBy="friendsWithMe")
     * @JoinTable(name="friends",
     *      joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
     *      inverseJoinColumns={@JoinColumn(name="friend_user_id", referencedColumnName="id")}
     *      )
     **/
    private $myFriends;

    public function __construct() {
        $this->friendsWithMe = new \Doctrine\Common\Collections\ArrayCollection();
        $this->myFriends = new \Doctrine\Common\Collections\ArrayCollection();
    }

    // ...
}
simple_things_entity_audit:
    audited_entities:
        - App\Entity\User
        - 
    global_ignore_tables:
        - friends

Thanks.

dmitrach avatar Jan 22 '24 07:01 dmitrach