Skip to content

Commit db14f0f

Browse files
Adding Attributes code block (#9161)
Just that there is some real-world example somewhere ;-) see #9020 (comment)
1 parent 9a74ae6 commit db14f0f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/en/reference/events.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,19 @@ An entity listener is a lifecycle listener class used for an entity.
795795

796796
.. configuration-block::
797797

798-
.. code-block:: php
798+
.. code-block:: attribute
799+
800+
<?php
801+
namespace MyProject\Entity;
802+
use App\EventListener\UserListener;
803+
804+
#[Entity]
805+
#[EntityListeners([UserListener::class])]
806+
class User
807+
{
808+
// ....
809+
}
810+
.. code-block:: annotation
799811
800812
<?php
801813
namespace MyProject\Entity;

0 commit comments

Comments
 (0)