[TYPO3-mvc] How to use the repository within a hook?

Christian Zenker christian.zenker at 599media.de
Wed Aug 11 15:37:22 CEST 2010


On Wed, 11 Aug 2010 15:07:17 +0200, S.Korth <s.korth at dms-arts.com> wrote:

> I found this example here, but with my code it doesn't work (empty).
>
> http://forge.typo3.org/projects/extension-cz_simple_cal/repository/entry/trunk/Classes/Indexer/Event.php

The fetchEventObject() in the linked source does the trick. It calls a  
manually created findOneByUidEverywhere() method in the repository - and  
that's where the magic happens.

The difficulty you are facing is the storagePid. Right now something like  
"WHERE ... AND pid IN (0)" is appended to all the SQL. You can unset the  
limitation to the storagePid by setting  
$query->getQuerySettings()->setRespectStoragePage(false); in the  
repository. This is done in the example, too - so just have a look.

Christian.


More information about the TYPO3-project-typo3v4mvc mailing list