[TYPO3-mvc] Work with many tables which all have the same structure

Steffen Ritter info at rs-websystems.de
Tue Sep 20 07:22:32 CEST 2011


Am 19.09.2011 19:28, schrieb Stefan Frömken:
> Hello MVC-Team,
>
> we have a huge database here which has many tables which all have the
> same structure. For this example each table with the customer-id as name
> contains all invoices for this customer.
>
> You're right if you say: It's better to move all records in ONE huge
> table and don't seperate this. But this decision was made before my time.
>
> For now I don't see any possibility to loop through all this tables and
> map them to ONE model. OK...I can create a model for each table, but
> what happens if a new customer will be created?
>
> I tried really many things:
> - In my loop I tried to change the TS-Mappings for my current Model. But
> this works only ONCE. After that, the Level1-Cache don't allows me to
> remapp this Model to another model.
> - I tried to work with Modelnames which are not defined. But there is a
> method which checks a Modelname against PHP function class_exists().
> - I tried to build my own QueryManager and Query.
>
> How can I access tables with Fluid without having a model foreach table?
>
> And ideas?
>
> Stefan

i would create an object with from ARRAY and to Array and write my own 
Repository Methods directly querying the Database using GLOBALS[TYPO3_DB]

As you said your aim is fluid and not persistence magic - go for it :P


More information about the TYPO3-project-typo3v4mvc mailing list