[TYPO3-mvc] How to get calculated data from a query into an object?

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Feb 16 22:55:12 CET 2010


Hi,

>> I'm currently struggling with a query returning stores from the
>> repository, that are near by the visitors location. The stores get found
>> nicely by my custom statement, but how can I assign a row value
>> "distance" that got calculated by MySQL to a property to my store
>> objects? The distance is not part of the general domain and should not
>> get persisted etc., but it is required for this special purpose.
>
> You could create a transient (value) object NearbyStore that holds a reference to a store object and
> the distance. Or you could simply create an array with entries that hold - yes - the store reference
> and the distance.

And how would I fetch the transient objects? I can't use a repository, 
as I would have the same issue there (extbase is not mapping non-TCA 
properties without my hack). And extbase itself is currently hard to use 
via api to get query results as arrays. Of course I can use TYPO3_DB 
directly to get the job done (fetching arrays etc) - but that was not 
the point. I wondered how this would/could/should be done by design in 
FLOW3/extbase.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list