1
votes

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

1

1 Answers

1
votes
  1. 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 ).

  2. Make also sure your Entity name is written right (Upper/Lowecase) in config.yml, there seems to be no error if its wrong