Skip to content

Commit 41a8c3d

Browse files
Deprecate enabling controller resolver auto mapping
1 parent 794cb9e commit 41a8c3d

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

UPGRADE-2.13.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
UPGRADE FROM 2.12 to 2.13
2+
========================
3+
4+
Configuration
5+
-------------
6+
7+
### Controller resolver auto mapping deprecated
8+
9+
The controller resolver auto mapping functionality has been deprecated with Symfony 7.1, and is replaced with explicit mapped route parameters. Enabling the auto mapper using this bundle is now deprecated as well. The configuration option will be fully removed in 3.0.
10+
11+
Auto mapping uses any route parameter that matches with a field name of the Entity to resolve as criteria in a find by query.
12+
13+
If you are relying on this functionality, you can update your code to use explicit mapped route parameters instead.

UPGRADE-3.0.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ UPGRADE FROM 2.x to 3.0
44
Configuration
55
-------------
66

7-
### Controller resolver auto mapping default configuration changed
7+
### Controller resolver auto mapping configuration removed
88

9-
The default value of `doctrine.orm.controller_resolver.auto_mapping` has changed from `true` to `false`.
9+
The `doctrine.orm.controller_resolver.auto_mapping` configuration option has been removed.
1010

11-
Auto mapping uses any route parameter that matches with a field name of the Entity to resolve as criteria in a find by query.
11+
Auto mapping used any route parameter that matches with a field name of the Entity to resolve as criteria in a find by query. This method has been deprecated in Symfony 7.1 and is replaced with mapped route parameters.
1212

13-
If you were relying on this functionality, you will need to explicitly configure this now.
13+
If you were relying on this functionality, you will need to update your code to use explicit mapped route parameters instead.
1414

1515
Types
1616
-----

src/DependencyInjection/DoctrineExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,10 @@ protected function ormLoad(array $config, ContainerBuilder $container)
529529
$config['controller_resolver']['auto_mapping'] = true;
530530
}
531531

532+
if ($config['controller_resolver']['auto_mapping'] === true) {
533+
trigger_deprecation('doctrine/doctrine-bundle', '2.13', 'Enabling the controller resolver automapping feature has been deprecated. Symfony Mapped Route Parameters should be used as replacement.');
534+
}
535+
532536
if (! $config['controller_resolver']['auto_mapping']) {
533537
$controllerResolverDefaults['mapping'] = [];
534538
}

0 commit comments

Comments
 (0)