[TYPO3-mvc] Auto-Updating related objects

Georg Grossberger georg at grossberger.at
Mon Jul 11 20:51:29 CEST 2011


Hi everyone

I'm currently working on an extension that fetches most of its data from 
a REST API. The problem is, I do not want to save all data (eg.: by 
running a scheduler task every day), because that would create thousands 
of records that will never be used. For the aggregate roots that is not 
a problem. If a findOneByName does not return a result, ask the API. The 
problem are related objects.

eg.:
$account = $accountRepository->findOneByName($name); // Already exists
$roles = $account->getRoles(); // Related role objects can change over time

foreach($roles as $role) $role->getName(); // ....

My first approach was to subclass Tx_Extbase_Persistence_ObjectStorage, 
but that is hardcoded in extbase, so it does not work.

Another approach was to subclass the DataMapper, to search for new 
objects or changes in existing objects, which will not work if it is a 
lazy loaded object.

Overloading the LazyLoadingProxy and LazyObjectStorage will not work 
either because they are hardcoded too.

So before I start hacking around, any ideas?

Greets
Georg


More information about the TYPO3-project-typo3v4mvc mailing list