From 10c20af7d08ea4a77923a35d61bda1508b09c7ce Mon Sep 17 00:00:00 2001 From: "Cadot.eu & Co." <97225403+cadot-eu@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:53:31 +0200 Subject: [PATCH 1/2] Add documentation for enum property.rst A note and an example class for the enum type which has an undocumented peculiarity on the path to give --- doctrine.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doctrine.rst b/doctrine.rst index 171f8a3348a..732d4894deb 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -174,6 +174,22 @@ Whoa! You now have a new ``src/Entity/Product.php`` file:: Confused why the price is an integer? Don't worry: this is just an example. But, storing prices as integers (e.g. 100 = $1 USD) can avoid rounding issues. +.. note:: + + For a property name `Enum` get the path (e.g. App\Entity\Enums\etat) + A State.php example ``src/Entity/Enums/State.php`` file:: + + // src/Entity/Enums/State.php + namespace App\Entity\Enums; + + enum Etat: string + { + case IN_PROGRESS = 'In progress'; + case COMPLETED = 'Completed'; + case PENDING = 'Pending'; + } + + .. warning:: There is a `limit of 767 bytes for the index key prefix`_ when using From 7f9b155c9b0b8923148d45b6eb8035079c23f8cc Mon Sep 17 00:00:00 2001 From: "Cadot.eu & Co." <97225403+cadot-eu@users.noreply.github.com> Date: Mon, 21 Apr 2025 14:01:32 +0200 Subject: [PATCH 2/2] Update doctrine.rst patchs Co-authored-by: Oskar Stark --- doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doctrine.rst b/doctrine.rst index 732d4894deb..89b7348baef 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -176,7 +176,7 @@ Whoa! You now have a new ``src/Entity/Product.php`` file:: .. note:: - For a property name `Enum` get the path (e.g. App\Entity\Enums\etat) + For a property name ``Enum`` get the path (e.g. `` App\Entity\Enums\Etat``) A State.php example ``src/Entity/Enums/State.php`` file:: // src/Entity/Enums/State.php