Skip to content

Commit

Permalink
Correct reverse relationship for hasOne
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota committed Sep 30, 2020
1 parent f116d64 commit 1c1f379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Listener/JsonApiListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ protected function _fetchRelated(Subject $subject): void
$association = $fromRepository->getAssociation($relationName);
$associationType = $association->type();
$reverseAssociationTypes = [
Association::ONE_TO_ONE => [Association::ONE_TO_MANY], // hasOne -> belongsTo
Association::ONE_TO_ONE => [Association::MANY_TO_ONE], // hasOne -> belongsTo
Association::MANY_TO_ONE => [Association::ONE_TO_ONE, Association::ONE_TO_MANY], // belongsTo -> hasOne or hasMany
Association::ONE_TO_MANY => [Association::MANY_TO_ONE], // hasMany -> belongsTo
Association::MANY_TO_MANY => [Association::MANY_TO_MANY],
Expand Down

0 comments on commit 1c1f379

Please sign in to comment.