fixed wrong ID output for many_many and has_many relations

This commit is contained in:
Ju 2013-10-06 17:36:31 +02:00
parent 902c8db859
commit e49d247fba

View File

@ -97,7 +97,7 @@ class JSONDataFormatter extends DataFormatter {
$innerParts[] = ArrayData::array_to_object(array( $innerParts[] = ArrayData::array_to_object(array(
"className" => $relClass, "className" => $relClass,
"href" => "$href.json", "href" => "$href.json",
"id" => $item->$fieldName "id" => $item->ID
)); ));
} }
$serobj->$relName = $innerParts; $serobj->$relName = $innerParts;
@ -118,7 +118,7 @@ class JSONDataFormatter extends DataFormatter {
$innerParts[] = ArrayData::array_to_object(array( $innerParts[] = ArrayData::array_to_object(array(
"className" => $relClass, "className" => $relClass,
"href" => "$href.json", "href" => "$href.json",
"id" => $item->$fieldName "id" => $item->ID
)); ));
} }
$serobj->$relName = $innerParts; $serobj->$relName = $innerParts;