Hi,
I am working on a custom configuration file so I can add Doctrine2 extensions in ORM Designer 2. I am almost done, but there is some strange behaviour.
This is my custom Doctrine2.ormd2.cfg.xml (only relevant parts are shown)
<ormd2-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<orm-configuration name="Doctrine2">
<attribute-types>
<struct name="Field">
<ordered name="gedmo" help-text="Doctrine2 behavioral extensions - Possible string values: sortablePosition, sortableGroup, translatable, treeLeft, treeRight, treeRoot, treeLevel" type="string"></ordered>
</struct>
<struct name="Association">
<struct name="side-owning" help-text="Properties of owning relation">
<ordered name="gedmo" help-text="Doctrine2 behavioral extensions - Possible values: treeParent" type="string"></ordered>
</struct>
</struct>
</attribute-types>
</orm-configuration>
</ormd2-configuration>
The first problem is that I need enums instead of strings. But for some reason, when I do:
<ordered name="gedmo" help-text="Doctrine2 behavioral extensions" type="enum" enum-values="sortablePosition|sortableGroup|translatable|treeLeft|treeRight|treeRoot|treeLevel"></ordered>
.. the dropdown in the ORM Designer 2 GUI stays empty. That could be a bug. Anyway, let's use a string type instead.
This is my configuration (just a test with dummy values):


Now, let's export it to YAML.
Serius\PhotoBundle\Entity\SlideshowItem:
type: entity
table: slideshow_item
fields:
id:
id: true
generator:
strategy: AUTO
image:
nullable: false
gedmo: [foo,bar] <-- this is good
gedmo: <-- ?
value: foo <-- ?
value: bar <-- ?
link:
nullable: true
text:
nullable: true
visible:
nullable: false
order:
nullable: true
oneToMany:
barAlias:
targetEntity: Serius\PhotoBundle\Entity\SlideshowItem
mappedBy: fooAlias
manyToOne:
fooAlias:
targetEntity: Serius\PhotoBundle\Entity\SlideshowItem
inversedBy: barAlias
gedmo: [foo,bar] <-- good
joinColumns:
slideshow_item_id:
referencedColumnName: id
nullable: false
Do you see? Looks like the inside the Field is exported different than inside the Association.
So, what may be bugs:
- Ordered lists with enum types are not supported? If not, can you show an example?
- Ordered lists are not always well exported.
N.B. I will share my configuration soon, on the ORM Designer forums.