I went through a strange "bug".
I have 2 associations on an entity with "almost the same same" :
/**
* @ORM\OneToOne(targetEntity="TaxeApprentissage\Entity\Collecteur\Parametres", mappedBy="collecteur")
*/
private $parametres;
/**
* @ORM\OneToOne(targetEntity="TaxeApprentissage\Entity\Collecteur\ParametresEdition", mappedBy="collecteur")
*/
private $parametresEdition;
When lazy loading happens, I got the exact same object TaxeApprentissage\Entity\Collecteur\ParametresEdition
in both properties $parametres
and $parametresEdition
.
But when I reverse the associations :
/**
* @ORM\OneToOne(targetEntity="TaxeApprentissage\Entity\Collecteur\ParametresEdition", mappedBy="collecteur")
*/
private $parametresEdition;
/**
* @ORM\OneToOne(targetEntity="TaxeApprentissage\Entity\Collecteur\Parametres", mappedBy="collecteur")
*/
private $parametres;
Everything is working perfectly. I get the correct object for each association.
Is it caused by the fact that the entities are named almost similar?