[TYPO3-mvc] After introducing "tx_extbase_type" my frontendusers aren't outputted

Jochen Rau jochen.rau at typoplanet.de
Wed Apr 21 13:25:09 CEST 2010


Hi.

On 21.04.10 10:43, Jochen Rau wrote:
> But I agree that the current solution with the type field isn't really
> sufficient. Let's collect some suggestions.

I had a short discussion with Sebastian about this issue. We came to a 
new proposal:

Currently Extbase takes the class name as record type if nothing is 
specified. We propose to alter this behavior. If there is no record type 
specified, no type constraint will be added.

Let's assume we have the following class hierarchy (same as in 
"[TYPO3-mvc] [!!!] FYI: Implemented first version of single table 
inheritance.")

                 Party
                 |   |
       Organization   Person
         |     |
    Company ScientificInstitution

And let's assume we have only one table "party" and the following config

config.tx_extbase.persistence.classes {
   Organization {
     mapping {
       tableName = party
     }
     subclasses {
       Company = Company
       ScientificInstitution = ScientificInstitution
     }
   }
   Person {
     mapping {
       tableName = party
     }
   }
   Company {
     mapping {
       tableName = party
       recordType = Company
     }
   }
   ScientificInstitution {
     mapping {
       tableName = party
       recordType = ScientificInstitution
     }
   }
}

Please note that there isn't a recordType defined for Person and 
Organization. And please note that there might be records of all 
classes, but in case of Party, Organization, and Person the type field 
is an empty string (new default for the field).

$companyRepository->findAll() will return only instances of Company class.

$organizationRepository->findAll() will return instances of Company and 
ScientificInstitution classes, but no instance of Organization class. If 
we add "recordType = Organization" and there are records of this type, 
findAll() will also return Organization instances.

$personRepository->findAll() will return all records mapped to class 
Person (boom!). In this case we *must* add "recordType = Person" or we 
have to set up our own table "person" for this.

What do you think about this proposal?

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list