Skip to content

Commit 41bea4e

Browse files
mdoutreluingnejaviereguiluz
authored andcommitted
Add message to #[MapEntity] for NotFoundHttpException
1 parent ce23225 commit 41bea4e

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)