Closed V-Orbit closed 5 years ago
Good point! Currently you can't set a relation to null using the ItemHydrator
, but you can do it manually:
$item = $typeMapper->getMapping('node--ordini');
$item->publisher()->dissociate();
I'll leave this issue open to implement this in the ItemHydrator
!
Good point! Currently you can't set a relation to null using the
ItemHydrator
, but you can do it manually:$item = $typeMapper->getMapping('node--ordini'); $item->publisher()->dissociate();
I'll leave this issue open to implement this in the
ItemHydrator
!
@JaZo fantastic! So I hit the point. Figuring out the way to workaround that, I implemented the setter exactly as you stated, really little before you wrote the comment :-D
Fantastic work @JaZo! I'll update the library immediately! thanks for your help 💓
Hi @JaZo ! Just don't figure how to set a relation to null when saving a content which had a previous relation set. Relation "publisher" is a hasOne relation
This is the attributes/relations array prior to hydration. this array works as expected.
I already tried to:
publisher
arraypublisher => null
"id" => "none"
"id" => "null"
"id" => null
"id" => 0
Of course, if I completely remove the
publisher
entry from theordineAttributes
array, the hydrator steps over and leaves the previous value unchanged.What I'm doing wrong?
I also get errors when I do