Skip to content

Pass Request to EntityValueResolver #18991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alexandre-daubois
Copy link
Member

Fix #18987

@carsonbot carsonbot added this to the 6.4 milestone Oct 5, 2023
@carsonbot carsonbot changed the title [DoctrineBridge] Pass Request to EntityValueResolver Pass Request to EntityValueResolver Oct 5, 2023
doctrine.rst Outdated
public function show(
Product $product,
#[MapEntity(expr: 'repository.findBy(["product_id" => id], null, request.query.get("limit", 10)')]
Comment $comment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn'it be an array/collection ? due to the findBy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, thanks!

@alexandre-daubois alexandre-daubois force-pushed the request-expression-value-resolver branch from 57f3cac to 665f51d Compare October 6, 2023 11:22
doctrine.rst Outdated
@@ -746,6 +746,23 @@ In the example above, the ``$product`` argument is handled automatically,
but ``$comment`` is configured with the attribute since they cannot both follow
the default convention.

If you need to get other information from the request to fetch your entity, you
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, but then this should be your entities, or at least your data ^^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded to match any case 👌

@OskarStark
Copy link
Contributor

Thank you Alexandre.

@OskarStark OskarStark merged commit acd3fe2 into symfony:6.4 Oct 6, 2023
@alexandre-daubois alexandre-daubois deleted the request-expression-value-resolver branch October 6, 2023 15:29
@seb-jean

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DoctrineBridge] Pass Request to EntityValueResolver's expression
6 participants