[Closed] <ordered type="string"> strange export

0 votes
asked Mar 14, 2013 in Solved by Dirk (250 points)
recategorized Oct 13, 2015 by ludek.vodicka

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):
enter image description here

enter image description here

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:

  1. Ordered lists with enum types are not supported? If not, can you show an example?
  2. Ordered lists are not always well exported.

N.B. I will share my configuration soon, on the ORM Designer forums.

commented Mar 14, 2013 by ludek.vodicka Skipper developer (140,450 points)

Thanks for detailed bug report. We will check it.

2 Answers

0 votes
answered Jun 30, 2014 by Martin Freki Stradej Skipper developer (74,840 points)
selected Jul 30, 2014 by Martin Freki Stradej
 
Best answer

The custom attribute creation was modified and updated in the version 3.0.0.1099, and released to public today. Please, try the behavior now, and let me know if you still had any problems with this configuration.

From version 3.0, ORM Designer was renamed to Skipper. You can download Skipper from the official website:
www.skipper18.com/en/download

0 votes
answered Nov 26, 2015 by ludek.vodicka Skipper developer (140,450 points)

Starting with version 3.2.5.1264 Skipper fully supports Gedmo extensions.

Currently support is in beta stage.

More info http://support.skipper18.com/2290/gedmo-extensions-beta-support

...