[TYPO3-mvc] resolve single table inheritance objects
Felix Oertel
f at oer.tel
Thu Mar 31 12:25:03 CEST 2011
hey,
something i talked about with different people (thanks fkoch for your
input) bothers me again and i would like to find a "final" solution.
using single table inheritance, i've got a class Event (which is not to
be used directly) and the inherited classes Workshop and Exhibition.
i've got an Event-, Workshop- and Exhibition-repository.
case 1:
i want to select a workshop. i do $workshopRepository->findOneBy*() and
i'll get back an Workshop-object.
case 2:
i want to select a group of events of different types. i do
$eventRepository->findBy*() and i'll get back an objectStorage with some
Event-objects in it.
this is not what i want. ;) i'd more like to get back an objectStorage
with mixed Workshop- and Exhibition-objects.
at a first glance my idea would be to resolve the correct object-type
trough the sti-configuration. we could go the other way around, read out
the type-field from the db, look up which class is supposed to handle
this and then build the object of the correct type in the dataMapper.
what do you think? is there something similar in FLOW3 we have to care
about? any ideas?
regards, foertel
More information about the TYPO3-project-typo3v4mvc
mailing list