0 votes

Currently when you add custom attributes to Doctrine2.ormd2.cfg.xml file under the "Field" and "Entity" tags, these export to the Doctrine2 YAML without issue, but if you add custom attributes to under either or these do not export. We use a custom Doctrine YAML Driver that knows how to interpret these custom attributes. Please add either some option to export these or provide resources/examples on how I would go about doing this myself, if possible. Thanks!

in Solved by
recategorized by

2 Answers

0 votes
Best answer

New version 2.1.10.697 with this feature/bugfix was released.
Please download latest version here http://www.orm-designer.com/download-orm-designer

by Skipper developer (141k points)
selected by
0 votes

Next ORM Designer version will contain following update:

We extended Doctrine2 export scripts to export custom properties for owner/inverse side and for association columns properties. Here is our test case:

Our custom configuration xml:

<struct name="Association">
  <attribute name="custom-root" .../>
    <struct name="side-owning">
  <attribute name="custom-owning"...>
  </struct>
  <struct name="side-inverse">
    <attribute name="custom-inverse"/>
  </struct>
</struct>

So our ORM Designer Property editor now looks like this:

http://i.imgur.com/MAiVYtI.png

If you fill properties like in our example, result doctrine XML will looks like this:

<entity name="E2">
...
  <many-to-one field="t1" target-entity="SampleEntity" inversed-by="t2" custom-owning="custom-owning">
    <join-columns>
      <join-column name="sample_entity_id" referenced-column-name="id" nullable="false" custom-root="custom-root"/>
    </join-columns>
  </many-to-one>
...
</entity>

<entity name="SampleEntity">
...
  <one-to-many field="t2" target-entity="E2" mapped-by="t1" custom-inverse="custom-inverse"/>
...
</entity>

And of course this same is true for YAML export format:

E2:
 ...
  manyToOne:
    t1:
    ...
      customOwning: custom-owning
      joinColumns:
        sample_entity_id:
          ...
          customRoot: custom-root
SampleEntity:
...
  oneToMany:
    t2:
      ...
      customInverse: custom-inverse

I hope we cover all possible variants. This update will be available in the next ORM Designer release.

by Skipper developer (141k points)
edited by