Prezent / doctrine-translatable

Translatable behaviour extension for Doctrine2
MIT License
26 stars 17 forks source link

[RFC][WIP] XML mapping #16

Closed gonzalovilaseca closed 9 years ago

gonzalovilaseca commented 9 years ago

Hi, I'm working on a XML mapper loader for Prezent, so far I've come up with this configuration:

# BlogPost.orm.xml
       <prezent:translatable field="translations" target-entity="BlogPostTranslation" current-locale="currentLocale" fallback-locale="fallbackLocale"/>

And:

# BlogPostTranslation.orm.xml
        <prezent:translatable field="translatable" target-entity="BlogPost"/>
        <field name="locale" column="locale" type="string" length="2">
            <prezent:locale />
        </field>

So far my XML loader transforms this configuration into an array that has the same structure as the array that the YML loader receives, therefore my XML loader might extend (I need to refactor) the YML overriding isValidDriver and protected function parse($file).

Is this something that could be added to Prezent?

sandermarechal commented 9 years ago

Yes, definitely. I'm closing this since you also opened a pull request in #17