You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue:
Calling relationship setter on a HasManyThrough (HasManyDeep) relationship will throw the exception: "Method does not exist on QueryBuilder [applySetter]"
How to Replicate:
Define a HasManyThrough relationship:
// Page entity
// a `Page` has many `Category` through intermediate `PageCategory` entities
function categories() {
return hasManyThrough( [ "pageCategories", "category" ] );
}
function pageCategories() {
return hasMany( "PageCategory@cms", "pageId" );
}
Attempt to call the setter in your handler:
prc.page.setCategories( "1,2,3" );
Expected:
I expected the relationship setter to function like the other relationship types and persist the new categories via the PageCategory intermediate entity.
Actual Result:
Throws exception.
Workarounds?
None that I can think of unless you work directly with the intermediate entity relationship, but that creates complexity in your handlers or model, which I believe should be handled by the ORM.
The text was updated successfully, but these errors were encountered:
Issue:
Calling relationship setter on a HasManyThrough (HasManyDeep) relationship will throw the exception:
"Method does not exist on QueryBuilder [applySetter]"
How to Replicate:
Expected:
I expected the relationship setter to function like the other relationship types and persist the new categories via the
PageCategory
intermediate entity.Actual Result:
Throws exception.
Workarounds?
None that I can think of unless you work directly with the intermediate entity relationship, but that creates complexity in your handlers or model, which I believe should be handled by the ORM.
The text was updated successfully, but these errors were encountered: