$referenceField = $parent->getFields()->getByStorageName($fkField->getReferenceField()); if(!$referenceField){ thrownew \RuntimeException( sprintf( 'Can not detect reference field with storage name %s in definition %s', $fkField->getReferenceField(), $parent->getEntityName() ) ); }
$primaryKeys = [];
$fk = $fks[$key]; // check if the payload field is a foreign key which we have to consider
if(!$fk instanceof FkField || $value === null){ continue; }
// create a hash for the foreign key which are used for the mapping
$primary = [$fk->getReferenceField() => $fk->getSerializer()->decode($fk, $value)];