Skip to content

Commit 10c20af

Browse files
authored
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
1 parent 9909f15 commit 10c20af

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doctrine.rst

+16
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,22 @@ Whoa! You now have a new ``src/Entity/Product.php`` file::
174174
Confused why the price is an integer? Don't worry: this is just an example.
175175
But, storing prices as integers (e.g. 100 = $1 USD) can avoid rounding issues.
176176

177+
.. note::
178+
179+
For a property name `Enum` get the path (e.g. App\Entity\Enums\etat)
180+
A State.php example ``src/Entity/Enums/State.php`` file::
181+
182+
// src/Entity/Enums/State.php
183+
namespace App\Entity\Enums;
184+
185+
enum Etat: string
186+
{
187+
case IN_PROGRESS = 'In progress';
188+
case COMPLETED = 'Completed';
189+
case PENDING = 'Pending';
190+
}
191+
192+
177193
.. warning::
178194

179195
There is a `limit of 767 bytes for the index key prefix`_ when using

0 commit comments

Comments
 (0)