Skip to content

Commit 3213ac5

Browse files
committed
minor #19477 Add message to #[MapEntity] for NotFoundHttpException (mdoutreluingne)
This PR was squashed before being merged into the 7.1 branch. Discussion ---------- Add message to #[MapEntity] for NotFoundHttpException Fixes #19476 Commits ------- 41bea4e Add message to #[MapEntity] for NotFoundHttpException
2 parents 3fd1c0c + 41bea4e commit 3213ac5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doctrine.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,21 @@ control behavior:
820820
``disabled``
821821
If true, the ``EntityValueResolver`` will not try to replace the argument.
822822

823+
``message``
824+
If a ``message`` option is configured, the value of the ``message`` option will be displayed in the development
825+
environment for the :class:`Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException` exception::
826+
827+
#[Route('/product/{product_id}')]
828+
public function show(
829+
#[MapEntity(id: 'product_id', message: 'The product does not exist')]
830+
Product $product
831+
): Response {
832+
}
833+
834+
.. versionadded:: 7.1
835+
836+
The ``message`` option was introduced in Symfony 7.1.
837+
823838
Updating an Object
824839
------------------
825840

0 commit comments

Comments
 (0)