Skip to content

Commit 414b707

Browse files
committed
minor #12481 Documented the doctrine_clear_entity_manager middleware (javiereguiluz)
This PR was merged into the 4.4 branch. Discussion ---------- Documented the doctrine_clear_entity_manager middleware Fixes #11657. Commits ------- 53fb21d Documented the doctrine_clear_entity_manager middleware
2 parents e121aaa + 53fb21d commit 414b707

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

messenger.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,11 @@ may want to use:
14071407
# or pass a different entity manager to any
14081408
#- doctrine_transaction: ['custom']
14091409
1410+
# After handling, the clear() method is executed in the
1411+
# entity manager, which reduces the memory consumption and
1412+
# avoids side-effects related to unrefreshed entities
1413+
- doctrine_clear_entity_manager
1414+
14101415
.. code-block:: xml
14111416
14121417
<!-- config/packages/messenger.xml -->
@@ -1432,6 +1437,8 @@ may want to use:
14321437
<framework:argument>custom</framework:argument>
14331438
</framework:middleware>
14341439
-->
1440+
1441+
<framework:middleware id="doctrine_clear_entity_manager"/>
14351442
</framework:bus>
14361443
</framework:messenger>
14371444
</framework:config>
@@ -1450,12 +1457,17 @@ may want to use:
14501457
'doctrine_close_connection',
14511458
// Using another entity manager
14521459
['id' => 'doctrine_transaction', 'arguments' => ['custom']],
1460+
'doctrine_clear_entity_manager',
14531461
],
14541462
],
14551463
],
14561464
],
14571465
]);
14581466
1467+
.. versionadded:: 4.4
1468+
1469+
The ``doctrine_clear_entity_manager`` middleware was introduced in Symfony 4.4.
1470+
14591471
Messenger Events
14601472
~~~~~~~~~~~~~~~~
14611473

0 commit comments

Comments
 (0)