Content-Length: 270522 | pFad | http://github.com/symfony/symfony/commit/f6a28d42b613fe06a995accd05b6d2afb66a15f7

FC bug #57248 [DoctrineBridge] Revert deprecating by-{id} mapping of ent… · symfony/symfony@f6a28d4 · GitHub
Skip to content

Commit f6a28d4

Browse files
committed
bug #57248 [DoctrineBridge] Revert deprecating by-{id} mapping of entities (nicolas-grekas)
This PR was merged into the 7.1 branch. Discussion ---------- [DoctrineBridge] Revert deprecating by-{id} mapping of entities | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT As discussed in #57211 Introduced in #54455 Commits ------- b81a62c [DoctrineBridge] Revert deprecating by-{id} mapping of entities
2 parents 31c597f + b81a62c commit f6a28d4

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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/symfony/symfony/commit/f6a28d42b613fe06a995accd05b6d2afb66a15f7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy