0 votes

See Doctrine docs 35. The Second Level Cache

We're considering using this feature, which would require our xml output to look like this

Image caption

Can ORMD support this already? If not, is it something you can add support for?

in Solved by (380 points)
recategorized by

I'm pretty close to setting this up in my project config. Here is what it looks like (with the other customizations removed):

<ormd2-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<orm-configuration name="Doctrine2">
    <attribute-types>
        <struct name="Entity">
            <struct name="cache" help-text= "" help-url="http://doctrine-orm.readthedocs.org/en/latest/reference/second-level-cache.html">
                <attribute name="usage" type="enum" enum-values="READ_ONLY|NONSTRICT_READ_WRITE|READ_WRITE" help-text=""/>
                <attribute name="region" type="string" help-text=""/>
            </struct>
        </struct>
    </attribute-types>
</orm-configuration>
</ormd2-configuration>

The only problem is, the XML output looks something like this now

  <entity name="Db\Entity\TestOrg">
    <cache>
      <region>default_region</region>
      <usage>NONSTRICT_READ_WRITE</usage>
    </cache>
  </entity>

Actually what we need is for the properties to be attributes of cache like this

  <entity name="Db\Entity\TestOrg">
    <cache region="default_region" usage="NONSTRICT_READ_WRITE"/>
  </entity>

It is not supported at the moment, but we are already looking onto it. It should be possible to partially implement this using custom parameters, but since it is a documented Doctrine functionality we will add full support for it to the ORM Designer.

I will let you know when the updated version is ready.

Could you help me with the syntax for custom parameters? I think I'm close with my project config file (see previous post), but so far I only figured out how to get my custom attributes to be output as xml elements. What I need is a way to define custom attributes to be output as xml attributes.

1 Answer

0 votes
Best answer

This function was implemented in the version 3.0.0.1099, and released to public today.

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

by Skipper developer (74.8k points)
selected by