From ab2a5b532838225c29a4a840b44d84bbefece101 Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Wed, 6 Nov 2024 08:42:03 +0100 Subject: [PATCH] add attributes example for entity in documentation --- Resources/doc/index.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index e2fb02b..6965210 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -311,6 +311,26 @@ for Doctrine's ORM: .. configuration-block:: + .. code-block:: php-attributes + + // src/Entity/User.php + namespace App\Entity; + + use Doctrine\DBAL\Types\Types; + use Doctrine\ORM\Mapping as ORM; + + #[Entity] + #[Table(name: 'user')] + class User + { + #[ORM\Id] + #[ORM\GeneratedValue(strategy: 'AUTO')] + #[ORM\Column(type: Types:INT)] + private $id; + + #[ORM\Column(type: Types:STRING, length: 255)] + private $name; + .. code-block:: php-annotations // src/Entity/User.php