Skip to content

Commit 6602359

Browse files
committed
from other pr comments
1 parent aabefe2 commit 6602359

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

doctrine.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -875,26 +875,24 @@ it is mandatory to use ``#[MapEntity]`` attributes and this can become cumbersom
875875
Document $document,
876876
): Response
877877
{
878-
// the database queries in this case would be:
878+
// this would result in the following database queries:
879879
// $document = $documentRepository->findOneBy(['id' => 'the id', 'name' => 'the name']);
880880
// $category = $categoryRepository->findOneBy(['slug' => 'the slug']);
881881
}
882882

883-
As an alternative, you can also use Mapped Route Parameters.
884-
885-
When adding route parameters, you can now define the mapping between the route parameter and the controller argument::
883+
By using mapped route parameters, you can define the mapping between the route parameter and the controller argument::
886884

887885
#[Route('/document/{slug:category}/{id:document}-{name:document}')]
888886
public function showDocument(Document $document, Category $category): Response
889887
{
890-
// the database queries in this case would be:
888+
// this would result in the following database queries:
891889
// $document = $documentRepository->findOneBy(['id' => 'the id', 'name' => 'the name']);
892890
// $category = $categoryRepository->findOneBy(['slug' => 'the slug']);
893891
}
894892

895893
.. versionadded:: 7.1
896894

897-
The mapped route parameters were introduced in Symfony 7.1.
895+
Mapped route parameters were introduced in Symfony 7.1.
898896

899897
Updating an Object
900898
------------------

0 commit comments

Comments
 (0)