[TYPO3-mvc] Resolve single table inheritance objects with namespace configuration
Max Rösch
autoexec.bat at gmail.com
Mon Feb 11 13:49:33 CET 2013
Hi there,
it's my first implementation of inheritance with extbase, so maybe this
one is realy simple.
I used the extension builder to set up the basic extension. There seem
to be some bugs with namespace, so the configuration wasn't created
correctly.
It looks something like this:
VENDORNAME\EbDirectory\Domain\Model\Maschine {
subclasses {
Tx_EbDirectory_Car = VENDORNAME\EbDirectory\Domain\Model\Car
Tx_EbDirectory_Motorbike = VENDORNAME\EbDirectory\Domain\Model\Motorbike
}
}
VENDORNAME\EbDirectory\Domain\Model\Car {
mapping {
tableName = tx_ebdirectory_domain_model_maschine
recordType = Tx_EbDirectory_Car
}
}
VENDORNAME\EbDirectory\Domain\Model\Motorbike {
mapping {
tableName = tx_ebdirectory_domain_model_maschine
recordType = Tx_EbDirectory_Motorbike
}
}
The extension builder set the names for the recordType accoring to it's
generated TCA
Backend works nicely.
Now to my problem / question:
I read in some articles and on the list that querying the
MaschineRepository with i.e. findAll() should give me an QueryResult
with both types of Maschines. But it seems the lookup process doesn't
work. I just get VENDORNAME\EbDirectory\Domain\Model\Maschine Objects.
There is another strange behaviour, if I query the Car repository but
didn't query the Maschine repository before I do get results that are
definitly type Motorbike, but seem to be casted to Car Object.
Anyone have a working configuration with namespaces (aka TYPO3 6.0)
Thanks
More information about the TYPO3-project-typo3v4mvc
mailing list