Skip to content

Commit 857d08e

Browse files
Neutron-ProNeutron-Pro
Neutron-Pro
authored and
Neutron-Pro
committed
complete the doc
1 parent c4d4532 commit 857d08e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.MD

+18-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class MyEnumType extends \NeutronStars\Enum\Types\EnumType {
3636
}
3737
```
3838

39-
And you must add this to the `doctrine.yaml` configuration file:
39+
You must add this to the `doctrine.yaml` configuration file:
4040

4141
```yml
4242
doctrine:
@@ -46,4 +46,21 @@ doctrine:
4646
class: App\Types\MyEnumType
4747
```
4848
49+
50+
On the annotation that contains the field of your entity, you must put the type:
51+
52+
```php
53+
/**
54+
* @ORM\Column(type="my_enum")
55+
* @var MyEnum|null
56+
*/
57+
private ?MyEnum $myEnum;
58+
```
59+
60+
you must comment out the column that contains the enum during your sql migration:
61+
62+
```php
63+
$this->addSql('COMMENT ON COLUMN "your_table"."your_column" IS \'(DC2Type:my_enum)\';');
64+
```
65+
4966
---

0 commit comments

Comments
 (0)