Skip to content

Commit 65e8c1f

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: We need to use AsEntityListener instead of AsDoctrineListener Update getContainerExtension()
2 parents cf1b86e + 8ee9da6 commit 65e8c1f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bundles/extension.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ method to return the instance of the extension::
5454

5555
// ...
5656
use Acme\HelloBundle\DependencyInjection\UnconventionalExtensionClass;
57+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
5758

5859
class AcmeHelloBundle extends Bundle
5960
{
60-
public function getContainerExtension()
61+
public function getContainerExtension(): ?ExtensionInterface
6162
{
6263
return new UnconventionalExtensionClass();
6364
}

doctrine/events.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ First, define a PHP class that handles the ``postUpdate`` Doctrine event::
255255
}
256256
}
257257

258-
Then, add the ``#[AsDoctrineListener]`` attribute to the class to enable it as
258+
Then, add the ``#[AsEntityListener]`` attribute to the class to enable it as
259259
a Doctrine entity listener in your application:
260260

261261
.. code-block:: php
@@ -265,9 +265,10 @@ a Doctrine entity listener in your application:
265265
266266
// ...
267267
use App\Entity\User;
268-
use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
268+
use Doctrine\Bundle\DoctrineBundle\Attribute\AsEntityListener;
269+
use Doctrine\ORM\Events;
269270
270-
#[AsDoctrineListener(event: 'postUpdate', method: 'postUpdate', entity: User::class)]
271+
#[AsEntityListener(event: Events::postUpdate, method: 'postUpdate', entity: User::class)]
271272
class UserChangedNotifier
272273
{
273274
// ...

0 commit comments

Comments
 (0)