[TYPO3-mvc] Is some sort of single table inheritance or a similar solution available?
Jochen Rau
jochen.rau at typoplanet.de
Fri Apr 9 11:07:22 CEST 2010
Hi Masi.
On 09.04.10 10:46, Martin Kutschker wrote:
>> A call to $textRepository->findAll() will return only Objects of class
>> Tx_Voila_Domain_Model_Content_Text. The problem is now: How to query for
>> all content elements? There is no $contentRepository->findAll().
>
> But there is a $contentRepository, right? I'm not sure if it's a good thing that I have (need?) a
> repository for each "record type". They all belong together and should therefore be accessed by the
> same repository via a $repository->find<Type>() method.
Of course it is not intended to have a repository for all sub-classes.
And my example is indeed a bit misleading. There is something called
content repository in FLOW3. But in the example extension "Voila"
introduced above I have to instanciate a content repository with
$blogRepository =
t3lib_div::makeInstance('Tx_Voila_Domain_Repository_ContentRepository')
But this Repository is only responsible for one class. In this case for
objects of class Tx_Voila_Domain_Model_Content. Thus it doesn't find any
objects of class Tx_Voila_Domain_Model_Content_Text.
Storing the type in a property doesn't solve the problem, because we
have to use a explicit class for type hinting.
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list