src/ShopWishlistBundle/objects/WebModules/MTPkgShopWishlistCore/MTPkgShopWishlistCore.class.php
protected function UpdateWishlist()
    {
        $aInput = $this->global->GetUserData(TdbPkgShopWishlist::URL_PARAMETER_FILTER_DATA);
        $sWishListDescription = '';
        if (array_key_exists('description', $aInput)) {
            $sWishListDescription = $aInput['description'];
        }
        $oMsgManager = TCMSMessageManager::GetInstance();

        $oUser = TdbDataExtranetUser::GetInstance();
        if ($oUser->IsLoggedIn()) {
            $oWishlist = &$oUser->GetWishlist(true);
            $aTmp = $oWishlist->sqlData;
            $aTmp['description'] = $sWishListDescription;
            if (array_key_exists('is_public', $aInput)) {
                $aTmp['is_public'] = $aInput['is_public'];
            }

            $oWishlist->LoadFromRow($aTmp);
            $oWishlist->Save();

            $aItems = array();
            if (array_key_exists('aItem', $aInput) && is_array($aInput['aItem'])) {
                $aItems = $aInput['aItem'];
                foreach ($aItems as $sWishlistItemId => $aItemData) {
                    $oWishlistItem = TdbPkgShopWishlistArticle::GetNewInstance();
                    /** @var $oWishlistItem TdbPkgShopWishlistArticle */
                    if ($oWishlistItem->LoadFromFields(array('pkg_shop_wishlist_id' => $oWishlist->id, 'id' => $sWishlistItemId))) {
                        $atmpData = $oWishlistItem->sqlData;
                        if (array_key_exists('comment', $aItemData)) {
                            $atmpData['comment'] = $aItemData['comment'];
                        }
                        if (array_key_exists('amount', $aItemData)) {
                            $atmpData['amount'] = $aItemData['amount'];
                        }
                        $oWishlistItem->LoadFromRow($atmpData);
                        $oWishlistItem->AllowEditByAll(true);
                        $oWishlistItem->Save();
                    }
                }
            }

            $oMsgManager->AddMessage($oWishlist->GetMsgConsumerName(), 'WISHLIST-UPDATED-INFOS');
        }
    }
protected function UpdateWishlist()
    {
        $aInput = $this->global->GetUserData(TdbPkgShopWishlist::URL_PARAMETER_FILTER_DATA);
        $sWishListDescription = '';
        if (array_key_exists('description', $aInput)) {
            $sWishListDescription = $aInput['description'];
        }
        $oMsgManager = TCMSMessageManager::GetInstance();

        $oUser = TdbDataExtranetUser::GetInstance();
        if ($oUser->IsLoggedIn()) {
            $oWishlist = &$oUser->GetWishlist(true);
            $aTmp = $oWishlist->sqlData;
            $aTmp['description'] = $sWishListDescription;
            if (array_key_exists('is_public', $aInput)) {
                $aTmp['is_public'] = $aInput['is_public'];
            }

            $oWishlist->LoadFromRow($aTmp);
            $oWishlist->Save();

            $aItems = array();
            if (array_key_exists('aItem', $aInput) && is_array($aInput['aItem'])) {
                $aItems = $aInput['aItem'];
                foreach ($aItems as $sWishlistItemId => $aItemData) {
                    $oWishlistItem = TdbPkgShopWishlistArticle::GetNewInstance();
                    /** @var $oWishlistItem TdbPkgShopWishlistArticle */
                    if ($oWishlistItem->LoadFromFields(array('pkg_shop_wishlist_id' => $oWishlist->id, 'id' => $sWishlistItemId))) {
                        $atmpData = $oWishlistItem->sqlData;
                        if (array_key_exists('comment', $aItemData)) {
                            $atmpData['comment'] = $aItemData['comment'];
                        }
                        if (array_key_exists('amount', $aItemData)) {
                            $atmpData['amount'] = $aItemData['amount'];
                        }
                        $oWishlistItem->LoadFromRow($atmpData);
                        $oWishlistItem->AllowEditByAll(true);
                        $oWishlistItem->Save();
                    }
                }
            }

            $oMsgManager->AddMessage($oWishlist->GetMsgConsumerName(), 'WISHLIST-UPDATED-INFOS');
        }
    }
protected function UpdateWishlist ( ) { $ aInput = $ this -> global -> GetUserData ( TdbPkgShopWishlist :: URL_PARAMETER_FILTER_DATA ) ; $ sWishListDescription = '' ; if ( array_key_exists ( 'description' , $ aInput ) ) { $ sWishListDescription = $ aInput [ 'description' ] ; } $ oMsgManager = TCMSMessageManager :: GetInstance ( ) ; $ oUser = TdbDataExtranetUser :: GetInstance ( ) ; if ( $ oUser -> IsLoggedIn ( ) ) { $ oWishlist = & $ oUser -> GetWishlist ( true ) ; $ aTmp = $ oWishlist -> sqlData ; $ aTmp [ 'description' ] = $ sWishListDescription ; if ( array_key_exists ( 'is_public' , $ aInput ) ) { $ aTmp [ 'is_public' ] = $ aInput [ 'is_public' ] ; } $ oWishlist -> LoadFromRow ( $ aTmp ) ; $ oWishlist -> Save ( ) ; $ aItems = array ( ) ; if ( array_key_exists ( 'aItem' , $ aInput ) && is_array ( $ aInput [ 'aItem' ] ) ) { $ aItems = $ aInput [ 'aItem' ] ; foreach ( $ aItems as $ sWishlistItemId => $ aItemData ) { $ oWishlistItem = TdbPkgShopWishlistArticle :: GetNewInstance ( ) ; /** @var $oWishlistItem TdbPkgShopWishlistArticle */ if ( $ oWishlistItem -> LoadFromFields ( array ( 'pkg_shop_wishlist_id' => $ oWishlist -> id , 'id' => $ sWishlistItemId ) ) ) { $ atmpData = $ oWishlistItem -> sqlData ; if ( array_key_exists ( 'comment' , $ aItemData ) ) { $ atmpData [ 'comment' ] = $ aItemData [ 'comment' ] ; } if ( array_key_exists ( 'amount' , $ aItemData ) ) { $ atmpData [ 'amount' ] = $ aItemData [ 'amount' ] ; } $ oWishlistItem -> LoadFromRow ( $ atmpData ) ; $ oWishlistItem -> AllowEditByAll ( true ) ; $ oWishlistItem -> Save ( ) ; } } } $ oMsgManager -> AddMessage ( $ oWishlist -> GetMsgConsumerName ( ) , 'WISHLIST-UPDATED-INFOS' ) ; } }
Updates the wishlist comment, the lists item amount an comments using the data from post.
Updates the wishlist comment the lists item amount an comments using the data from post .