fixed wrong ID output for many_many and has_many relations

JSONDataFormatter spits out the wrong ID for `has_many` and `many_many` relations.

This is a confusing bug, since the `$fieldName` is set before, when looping through the `->has_one()` relations and leaves a "random" value left for the `->has_many()` and `->many_many()` loops.