[TYPO3-mvc] Change storage backend / extending Typo3DbBackend

Jochen Rau jochen.rau at typoplanet.de
Wed Feb 3 12:10:28 CET 2010


Hi all.

On 29.01.10 14:39, dennis ahrens wrote:
> if u like to use your own StorageBackend for all your models have a
> look to the method:
>
> Tx_Extbase_Dispatcher::getPersistenceManager();
>
> There the Typo3DbBackend is instantiated and setted for all need obejcts.
> The PersistenceManager is a Singleton - if your write a Service that
> fetches this Object you can build up a instance of your
> StorageBackend-Class and inject this Object to the PersistenceManager.
>
> have a look at this Mailing-List-Topic:
> Tx_Extbase_Persistence_Backend::injectStorageBackend() missing
>
> i'm not sure if this solution is really clean - but for now i have no
> better idea and it works for me.

That won't work. The PeristenceManager holds an instance of the 
Persistence Backend. But this is different from the StorageBackend. 
Unfortunately, the StorageBackend is injected to the Persistence Backend 
at construction time (we have to change that). See the Dispatcher (line 
266).

A clean solution would be to implement Dependency Injection in Extbase.

See

http://blog.typoplanet.de/2009/07/16/a-walk-trough-the-persistence-layer-of-extbase/

for more infos about the persistence layers in Extbase/FLOW3.

Jochen



More information about the TYPO3-project-typo3v4mvc mailing list