8000 [DoctrineBridge] Revert deprecating by-{id} mapping of entities · symfony/symfony@b81a62c · GitHub
[go: up one dir, main page]

Skip to content

Commit b81a62c

Browse files
[DoctrineBridge] Revert deprecating by-{id} mapping of entities
1 parent 4d9fd2e commit b81a62c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Bridge/Doctrine/ArgumentResolver/EntityValueResolver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,8 @@ private function getIdentifier(Request $request, MapEntity $options, ArgumentMet
156156

157157
return $id ?? ($options->stripNull ? false : null);
158158
}
159-
if ($request->attributes->has('id')) {
160-
trigger_deprecation('symfony/doctrine-bridge', '7.1', 'Relying on auto-mapping for Doctrine entities is deprecated for argument $%s of "%s": declare the mapping using either the #[MapEntity] attribute or mapped route parameters.', $argument->getName(), method_exists($argument, 'getControllerName') ? $argument->getControllerName() : 'n/a');
161159

160+
if ($request->attributes->has('id')) {
162161
return $request->attributes->get('id') ?? ($options->stripNull ? false : null);
163162
}
164163

0 commit comments

Comments
 (0)
0