src/ShopWishlistBundle/objects/WebModules/MTShopBasketCore/MTShopWishlistBasketCore.class.php
protected function RemoveFromWishlist($sPkgShopWishlistArticleId = null, $sMessageHandler = null, $bIsInternalCall = false)
    {
        $oGlobal = TGlobal::instance();
        $aRequestData = $oGlobal->GetUserData(self::URL_REQUEST_PARAMETER);
        if (is_null($sPkgShopWishlistArticleId) && array_key_exists(self::URL_ITEM_ID_NAME, $aRequestData)) {
            $sPkgShopWishlistArticleId = $aRequestData[self::URL_ITEM_ID_NAME];
        }

        if (is_null($sMessageHandler) && array_key_exists(self::URL_MESSAGE_CONSUMER_NAME, $aRequestData)) {
            $sMessageHandler = $aRequestData[self::URL_MESSAGE_CONSUMER_NAME];
            if (empty($sMessageHandler)) {
                $sMessageHandler = null;
            }
        }
        if (is_null($sMessageHandler)) {
            $sMessageHandler = self::MSG_CONSUMER_NAME;
        }
        $oMessageManager = TCMSMessageManager::GetInstance();
        $oUser = TdbDataExtranetUser::GetInstance();
        if (!$oUser->IsLoggedIn()) {
            $oMessageManager->AddMessage($sMessageHandler, 'WISHLIST-USER-NOT-LOGGED-IN');
        } else {
            $oWishlistItem = TdbPkgShopWishlistArticle::GetNewInstance();
            /** @var $oWishlistItem TdbPkgShopWishlistArticle */
            $oWishlistItem->Load($sPkgShopWishlistArticleId);
            $oArticle = $oWishlistItem->GetFieldShopArticle();
            if ($oArticle) {
                $aMessageData = array('sArticleLinkStart' => '<a href="'.TGlobal::OutHTML($oArticle->GetDetailLink()).'">', 'sArticleLinkEnd' => '</a>', 'sArticleName' => $oArticle->GetName());
            } else {
                $aMessageData = array();
            }
            $oUser->RemoveArticleFromWishlist($sPkgShopWishlistArticleId);
            $oMessageManager->AddMessage($sMessageHandler, 'WISHLIST-REMOVED-ITEM', $aMessageData);
        }

        $iRedirectNodeId = null;
        if (array_key_exists(self::URL_REDIRECT_NODE_ID_NAME, $aRequestData)) {
            $iRedirectNodeId = $aRequestData[self::URL_REDIRECT_NODE_ID_NAME];
            if (empty($iRedirectNodeId)) {
                $iRedirectNodeId = null;
            }
        }

        if (!$bIsInternalCall) {
            $this->RedirectAfterEvent($iRedirectNodeId);
        }
    }
protected function RemoveFromWishlist($sPkgShopWishlistArticleId = null, $sMessageHandler = null, $bIsInternalCall = false)
    {
        $oGlobal = TGlobal::instance();
        $aRequestData = $oGlobal->GetUserData(self::URL_REQUEST_PARAMETER);
        if (is_null($sPkgShopWishlistArticleId) && array_key_exists(self::URL_ITEM_ID_NAME, $aRequestData)) {
            $sPkgShopWishlistArticleId = $aRequestData[self::URL_ITEM_ID_NAME];
        }

        if (is_null($sMessageHandler) && array_key_exists(self::URL_MESSAGE_CONSUMER_NAME, $aRequestData)) {
            $sMessageHandler = $aRequestData[self::URL_MESSAGE_CONSUMER_NAME];
            if (empty($sMessageHandler)) {
                $sMessageHandler = null;
            }
        }
        if (is_null($sMessageHandler)) {
            $sMessageHandler = self::MSG_CONSUMER_NAME;
        }
        $oMessageManager = TCMSMessageManager::GetInstance();
        $oUser = TdbDataExtranetUser::GetInstance();
        if (!$oUser->IsLoggedIn()) {
            $oMessageManager->AddMessage($sMessageHandler, 'WISHLIST-USER-NOT-LOGGED-IN');
        } else {
            $oWishlistItem = TdbPkgShopWishlistArticle::GetNewInstance();
            /** @var $oWishlistItem TdbPkgShopWishlistArticle */
            $oWishlistItem->Load($sPkgShopWishlistArticleId);
            $oArticle = $oWishlistItem->GetFieldShopArticle();
            if ($oArticle) {
                $aMessageData = array('sArticleLinkStart' => '<a href="'.TGlobal::OutHTML($oArticle->GetDetailLink()).'">', 'sArticleLinkEnd' => '</a>', 'sArticleName' => $oArticle->GetName());
            } else {
                $aMessageData = array();
            }
            $oUser->RemoveArticleFromWishlist($sPkgShopWishlistArticleId);
            $oMessageManager->AddMessage($sMessageHandler, 'WISHLIST-REMOVED-ITEM', $aMessageData);
        }

        $iRedirectNodeId = null;
        if (array_key_exists(self::URL_REDIRECT_NODE_ID_NAME, $aRequestData)) {
            $iRedirectNodeId = $aRequestData[self::URL_REDIRECT_NODE_ID_NAME];
            if (empty($iRedirectNodeId)) {
                $iRedirectNodeId = null;
            }
        }

        if (!$bIsInternalCall) {
            $this->RedirectAfterEvent($iRedirectNodeId);
        }
    }
protected function RemoveFromWishlist ( $ sPkgShopWishlistArticleId = null , $ sMessageHandler = null , $ bIsInternalCall = false ) { $ oGlobal = TGlobal :: instance ( ) ; $ aRequestData = $ oGlobal -> GetUserData ( self :: URL_REQUEST_PARAMETER ) ; if ( is_null ( $ sPkgShopWishlistArticleId ) && array_key_exists ( self :: URL_ITEM_ID_NAME , $ aRequestData ) ) { $ sPkgShopWishlistArticleId = $ aRequestData [ self :: URL_ITEM_ID_NAME ] ; } if ( is_null ( $ sMessageHandler ) && array_key_exists ( self :: URL_MESSAGE_CONSUMER_NAME , $ aRequestData ) ) { $ sMessageHandler = $ aRequestData [ self :: URL_MESSAGE_CONSUMER_NAME ] ; if ( empty ( $ sMessageHandler ) ) { $ sMessageHandler = null ; } } if ( is_null ( $ sMessageHandler ) ) { $ sMessageHandler = self :: MSG_CONSUMER_NAME ; } $ oMessageManager = TCMSMessageManager :: GetInstance ( ) ; $ oUser = TdbDataExtranetUser :: GetInstance ( ) ; if ( ! $ oUser -> IsLoggedIn ( ) ) { $ oMessageManager -> AddMessage ( $ sMessageHandler , 'WISHLIST-USER-NOT-LOGGED-IN' ) ; } else { $ oWishlistItem = TdbPkgShopWishlistArticle :: GetNewInstance ( ) ; /** @var $oWishlistItem TdbPkgShopWishlistArticle */ $ oWishlistItem -> Load ( $ sPkgShopWishlistArticleId ) ; $ oArticle = $ oWishlistItem -> GetFieldShopArticle ( ) ; if ( $ oArticle ) { $ aMessageData = array ( 'sArticleLinkStart' => '<a href="' . TGlobal :: OutHTML ( $ oArticle -> GetDetailLink ( ) ) . '">' , 'sArticleLinkEnd' => '</a>' , 'sArticleName' => $ oArticle -> GetName ( ) ) ; } else { $ aMessageData = array ( ) ; } $ oUser -> RemoveArticleFromWishlist ( $ sPkgShopWishlistArticleId ) ; $ oMessageManager -> AddMessage ( $ sMessageHandler , 'WISHLIST-REMOVED-ITEM' , $ aMessageData ) ; } $ iRedirectNodeId = null ; if ( array_key_exists ( self :: URL_REDIRECT_NODE_ID_NAME , $ aRequestData ) ) { $ iRedirectNodeId = $ aRequestData [ self :: URL_REDIRECT_NODE_ID_NAME ] ; if ( empty ( $ iRedirectNodeId ) ) { $ iRedirectNodeId = null ; } } if ( ! $ bIsInternalCall ) { $ this -> RedirectAfterEvent ( $ iRedirectNodeId ) ; } }
remove an item from the users wishlist.

@param string $sPkgShopWishlistArticleId - the pkg_shop_wishlist_article_id to remove from the list
@param string $sMessageHandler
@param bool   $bIsInternalCall
remove an item from the users wishlist .