src/ShopBundle/objects/TShopBasket/TShopBasketCore.class.php
public function CommitToSession($bForce = false)
    {
        // save copy to session
        if (TShopBasket::BasketInSession()) {
            $oTmp = TShopBasket::GetInstance();
            if (true === $bForce || $oTmp == $this) {
                $oUser = TdbDataExtranetUser::GetInstance();
                $oUser->ObserverUnregister('oUserBasket');

                /** @var Request $request */
                $request = \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest();
                /** @var TPKgCmsSession $session */
                $session = $request->getSession();
                $session->set(self::SESSION_KEY_NAME, $this);
            }
        }
    }
public function CommitToSession($bForce = false)
    {
        // save copy to session
        if (TShopBasket::BasketInSession()) {
            $oTmp = TShopBasket::GetInstance();
            if (true === $bForce || $oTmp == $this) {
                $oUser = TdbDataExtranetUser::GetInstance();
                $oUser->ObserverUnregister('oUserBasket');

                /** @var Request $request */
                $request = \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest();
                /** @var TPKgCmsSession $session */
                $session = $request->getSession();
                $session->set(self::SESSION_KEY_NAME, $this);
            }
        }
    }
public function CommitToSession ( $ bForce = false ) { // save copy to session if ( TShopBasket :: BasketInSession ( ) ) { $ oTmp = TShopBasket :: GetInstance ( ) ; if ( true === $ bForce || $ oTmp == $ this ) { $ oUser = TdbDataExtranetUser :: GetInstance ( ) ; $ oUser -> ObserverUnregister ( 'oUserBasket' ) ; /** @var Request $request */ $ request = \ ChameleonSystem \ CoreBundle \ ServiceLocator :: get ( 'request_stack' ) -> getCurrentRequest ( ) ; /** @var TPKgCmsSession $session */ $ session = $ request -> getSession ( ) ; $ session -> set ( self :: SESSION_KEY_NAME , $ this ) ; } } }
commits the basket to session, AND unregisters itself als an observer from
oUser - this method is called through the register_shutdown_function and should
not be called directly.

@param bool $bForce - overwrite session with basket data even if this is not the correct basket instance
if you use this to replace the basket object, make sure to call TShopBasket::GetInstance(false,true) after
to set the instance based on this new session
commits the basket to session AND unregisters itself als an observer from oUser - this method is called through the register_shutdown_function and should not be called directly .