Make EmbedsRelations::embedsMany and EmbedsRelations::embedsOne public#2588
Make EmbedsRelations::embedsMany and EmbedsRelations::embedsOne public#2588GromNaN merged 2 commits intomongodb:5.xfrom
EmbedsRelations::embedsMany and EmbedsRelations::embedsOne public#2588Conversation
There was a problem hiding this comment.
Pull request overview
Makes MongoDB embedded relationship helpers usable from outside the model (e.g., Model::resolveRelationUsing(...)) by aligning their visibility with other relationship methods in the package.
Changes:
- Change
EmbedsRelations::embedsMany()visibility fromprotectedtopublic. - Change
EmbedsRelations::embedsOne()visibility fromprotectedtopublic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @return EmbedsOne | ||
| */ | ||
| protected function embedsOne($related, $localKey = null, $foreignKey = null, $relation = null) | ||
| public function embedsOne($related, $localKey = null, $foreignKey = null, $relation = null) |
There was a problem hiding this comment.
embedsOne()'s docblock says "Define an embedded one-to-many relationship", but this method returns EmbedsOne and represents an embedded one-to-one relationship. Please update the docblock description to avoid misleading API docs now that the method is public.
alcaeus
left a comment
There was a problem hiding this comment.
Changes LGTM, and while I think we can skip test updates, fixing the description of embedsOne would be good.
2904fbe to
aca13c4
Compare
- Fix embedsOne docblock: "one-to-many" -> "one-to-one" - Add tests for direct call and resolveRelationUsing use case
Fix #2555
Other relation methods are public.