[TYPO3-mvc] ColumnMap: relations to tables with key field other then the UID (f.e. static_countries)

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Thu Jul 8 01:14:00 CEST 2010


Franz Koch wrote:
> Hey there,
>
> anybody already managed to map static_countries onto a model property,
> where the property value is not the UID of the static_country item but
> f.e. the cn_iso_3 code?
>
> Example: In the database the country is f.e. store as DEU or USA or AUT
> (iso_3 code) and I like to map that value to the static_countries table
> which I created a model for.
>
> I did a quick try but didn't succeed so far. Even a first attempt to add
> such a feature by setting a setChildKeyFieldName in the columnMap did
> not succeed so far.
>
> As I need the solution right away I'll use some workaround for now, but
> as this might be a feature more people might need we should find a way
> to enable this if it's not working already by some tweaked TCA which I
> didn't find out so far.

Hello Franz,

I have not dug into this more, but I recently created models for some
of the static info tables and encountered that the relation between e.g.
the static_country_zones and the static_countries is done via ISO codes
and not any parent-uid field.

I also needed this for the backend to only show country zones for a
selected country, but I needed the uid of the country in the field,
rather than the ISO code.

So yes, I'd need this feature, but I don't know how to implement it,
nor how to make a workaround for now.

Thomas


More information about the TYPO3-project-typo3v4mvc mailing list