Skip to content

Commit

Permalink
Handle relationships with no data during normalisation
Browse files Browse the repository at this point in the history
vimbadmin-api v1.1.0 now sends these through
  • Loading branch information
dpslwk committed Mar 6, 2020
1 parent 84cb2e9 commit fe2f6da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Serializer/Normalizer/ViMbAdminNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ public function denormalize($data, $class, $format = null, array $context = [])
foreach ($value as $type => $relations) {
if (isset($relations['data']['type'])) {
$relationships = [$relations['data']];
} else {
} else if (isset($relations['data'])) {
$relationships = $relations['data'];
}
if ( ! $relationships) {
} else {
break;
}
// if ( ! $relationships) {
// break;
// }

foreach ($relationships as $relation) {
$relationObject = new Relation();
Expand Down

0 comments on commit fe2f6da

Please sign in to comment.