eav-manager icon indicating copy to clipboard operation
eav-manager copied to clipboard

Many to Many not loaded

Open johnkrovitch opened this issue 5 years ago • 2 comments

It seems that many to many relations are only loaded on one side : I have a Publication and an Author which are linked with a middle-entity PublishedPublications.

$publication->get('publishedPublications'); // return a collection with several elements

$authors->get('publishedPublications'); // return an empty collection

johnkrovitch avatar Nov 26 '19 14:11 johnkrovitch

But when I call the finder :

$this->finder->findBy('PublishedPublication', [
     'author' => $author,
]); // returns results

johnkrovitch avatar Nov 26 '19 14:11 johnkrovitch

The same issue appears when saving entities. Entities are in the collection when using dump(), but when saving, the EAV removes the relation.

johnkrovitch avatar Jan 30 '20 09:01 johnkrovitch