[TYPO3-mvc] Extending Tx_Extbase_Domain_Model_FeUser with some kind of session object

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Wed Jan 13 02:20:49 CET 2010


Good morning!

Imagine a shop/store with several products which can
be put into a shopping cart, to buy them.

Now, if the FE user is not logged in, the products
should also be stored in the shopping cart, if the user
adds them to it.

If the user decides to process to the checkout, or
decides to log in, the products in the shopping cart
should stay, but after the user logs in, they should
be persisted.

I thought of creating a kind of 'session object' put
onto the FeUser Model, which 'persists' all kind of
data not into the database, but rather into the session.

After the user logs in, needed session data will be transformed
and/or cloned/copied into a FeUser object or will be persisted.

I'm not sure if this is the best way. And if, I'm not quite sure
how to create such kind of session user object which will store
data in the session. (Maybe it's just a wrapper class over the
FeUserAuth class of TYPO3, I'm not sure.)

How could I start this? What would be the best approach?

I thought of creating a model 'Tx_EXT_Domain_Model_Customer',
which extends the FeUser model, and holds the extra properties
like shopping cart items or/and orders.

But how will a non-logged in user fit in this scenario?
How can the data, put into a 'Guest' model, be persisted in the session?

Thanks a lot for your help and tipps!

Thomas


More information about the TYPO3-project-typo3v4mvc mailing list