[TYPO3-mvc] Using Repository outside a controller

Christian Zenker christian.zenker at 599media.de
Tue Jul 20 16:03:40 CEST 2010


On Tue, 20 Jul 2010 14:38:20 +0200, Dennis Ahrens  
<dennis.ahrens at googlemail.com> wrote:

Hi Dennis.
> You need a instance of the Dispatcher, that currently does the bootstrap  
> for the framework - try to create a Tx_Extbase_Dispatcher before you  
> build your repository.
Jep, a simple
	t3lib_div::makeInstance("Tx_Extbase_Dispatcher")
solved that issue. Thanks.

What did not really work was setting up the configuration in the  
dispatcher to allow fetching of records from all pages. But by creating a  
custom Repository method and setting
	$query->getQuerySettings()->setRespectStoragePage(false)
this could be solved. Although it would be nice being able to set this  
somewhere globally.

> To get your changes persisted, you also need an instance of the  
> Tx_Extbase_Persistence_Manager (and call it's persistAll()-method).

I need to try that yet - but thanks for the hint, I'm sure I would have  
forgotten that.

> regards
> Dennis


More information about the TYPO3-project-typo3v4mvc mailing list