simplethings/EntityAudit — Issue #9: Using the same entity in both OneToMany and OneToOne
Author: stefi023
Created: 2012-02-07 17:35:09+00:00
State: open

I have found an error while versioning entities like: (error is while auditing Customer entity)

````
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;
}
````

the UnitOfWork::getEntityIdentifier throws an notice "Undefined index: ........"
in UnitOfWork::entityIdentifiers array - the hash is different that the stored one