Skip to content

Commit 1c1f379

Browse files
committed
Correct reverse relationship for hasOne
1 parent f116d64 commit 1c1f379

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Listener/JsonApiListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ protected function _fetchRelated(Subject $subject): void
643643
$association = $fromRepository->getAssociation($relationName);
644644
$associationType = $association->type();
645645
$reverseAssociationTypes = [
646-
Association::ONE_TO_ONE => [Association::ONE_TO_MANY], // hasOne -> belongsTo
646+
Association::ONE_TO_ONE => [Association::MANY_TO_ONE], // hasOne -> belongsTo
647647
Association::MANY_TO_ONE => [Association::ONE_TO_ONE, Association::ONE_TO_MANY], // belongsTo -> hasOne or hasMany
648648
Association::ONE_TO_MANY => [Association::MANY_TO_ONE], // hasMany -> belongsTo
649649
Association::MANY_TO_MANY => [Association::MANY_TO_MANY],

0 commit comments

Comments
 (0)