[TYPO3-mvc] Dependency injection on object unserialization

Philipp Wrann philippwrann at gmail.com
Tue Jul 28 08:40:38 CEST 2015


I would simply persist a key-storage, so basically an associative array. When initializing a basket object for the view or other purposes you can still hand it to some service that fetches your product-entities.

Something like $this->view->assign('basket',$this->shoppingCartService->getBasket($products));
There something like
{
products : [
{uid:123,ammount:1},
{uid:1524,ammount:2}
]
}

is stored.

Would be much more simple and even more robust (you could even save the basket in a cookie/localStorage to persist it across sessions - and codechanges would not affect allready existing serializations because you habe a separat layer for serialization).


More information about the TYPO3-project-typo3v4mvc mailing list