mercredi 1 avril 2015

symfony fos user to session

short : how to store new fos user (or registration form), before persisting, in session ?


long :


scenario:



  1. anonymous user fills order form

  2. form check -> order entity to session -> redirect to registration form

  3. anonymous user fills registration form

  4. form check -> user entity to session -> redirect to checkout

  5. checkout -> persist user and order


I can get and set the order :



// form is valid
$r->getSession()->set('order', $order)

// in checkout
$r->getSession()->get('order')


and then persist my order.


how to do the same with user ?


informations we found :



  • a post about setting props protected : order has all private and it works.

  • not much more !


what are we doing wrong ?


Thanks and have a nice day !


Aucun commentaire:

Enregistrer un commentaire