[TYPO3-mvc] Change storage backend / extending Typo3DbBackend

dennis ahrens dennis.ahrens at googlemail.com
Sat Feb 6 10:49:33 CET 2010


Hi Jochen,

it works, if you add the injectStorageBackend() method to the PersistentBackend.
Please have a look at the topic
"Tx_Extbase_Persistence_Backend::injectStorageBackend() missing".
I'm still interested in your opinion related to this topic :->

regards
Dennis


2010/2/3 Jochen Rau <jochen.rau at typoplanet.de>:
> 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
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list