[TYPO3-mvc] Problem iterating through QueryResult (was: Re: Accessing external database table)

Markus Mahner lists at mahner.net
Mon Nov 29 12:35:32 CET 2010


Hi @all,

this is still driving me crazy. Is there nobody on this list that please could give me a hint?

To sum up the facts:
- I'm working on a plugin that has the single purpose to display data from some related tables.
- These tables are filled by an external application; therefore they don't have uid and pid columns, but at least id (primary key) columns that could be mapped to uid.
- The plugin does not need to be able to add, edit or delete records on these tables (neither BE nor FE).
- I've set up a Domain Model for the "root" table. Properties and table columns have identical names; though I have to explicitly map every column.
- $TCA['tx_myplugin_domain_model_event'] is an empty array - as I don't need to edit or display the records inside the backend, I did see no sense in configuring columns there.
- The Domain Model is mapped to the table by TS (setup.txt)
- The repository class is left empty.

Here's what happens:
- Obivously, I can access the right table - with findAll(), I get the correct record count, but when I iterate through this QueryResult, I only get the first record (repeatedly).
- I tried adding ctrl, types, interface and columns to the TCA, but no change. I still had to map every column explicitly. Info->Dataset overview did not show me any records.
- I tried to add a pid column and manually filled it with the pid of my test page. No result.


My basic questions are: 
- Why do I need to explicitly map each column to it's property, though the names are identical? According to the various documentations I found, this should not be necessary.
- Why am I getting only the first record of my table?

I guess I just don't understand how these things all work together; probably I just missed something stupid. Any hints are welcome!

thanks a lot,
µ.



Am 27.11.2010 um 16:03 schrieb Markus Mahner:

> Hi,
> 
> Am 26.11.2010 um 14:44 schrieb Markus Mahner:
>> Basically, it seems to work, as when I fetch all records on that table using findAll() and iterate through the result using <f:for>, I get the correct number of records (413); unfortunately, it's 413x the first record :(.
>> 
>> What am I missing?
> 
> No ideas, anybody? Sorry, I'm pretty new to Extbase (and TYPO3 extension development, fwiw)... Maybe I miss something obvious...
> 
> May it have something to do with the foreign table not having uid and pid columns? I tried mapping uid to the id column, with no luck. Is a pid column needed? Remember, the table is used read only (my plugin's main purpose is to display data from that and some related tables). If a pid column is needed, what should it contain?
> 
> best regards & thanks in advance,
> µ.
> 
> 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> 



More information about the TYPO3-project-typo3v4mvc mailing list