[TYPO3-mvc] How to get the plain DB value of a relation field?

Franz Koch typo3.RemoveForMessage at elements-net.de
Wed Jan 27 18:29:39 CET 2010


Hi again,

> I've got a TCA field with a DB relation (select) in one of my models,
> that I'd like to get as plain DB-value inside my model. Therefor I added
> "@var string" as annotation to the models property, but I always get a
> Tx_Extbase_Persistence_LazyLoadingProxy injected.
>
> Well, while it's correct TCA definition wise, it's wrong according to my
> annotation. So is this a bug? Or what do I have to do to get the plain
> DB value?
>
> Reason: it's a relation to a tt_content record that I'd like to render
> via TS - so I don't need a object.

ok, I've got a fix for this now - question is, is this acutally a bug? 
Shall I add a patch on forge?

What I do in my fix:
- in the datamapper, fetch the meta data of the property to be mapped
- get the propertyType from the object and use it if defined
- if nothing is defined or if the propertyType is unknown, use TCA 
definition

This is working for me now - and the blogExample is still up and 
running, too :)

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list