src/ShopBundle/pkgExtranet/objects/db/TShopDataExtranetUser.class.php
protected function PostLoginHookMergeTemporaryNoticeListWithDatabaseHistory()
    {
        // merge current notice list with existing notice list
        $aNoticeList = $this->GetNoticeListArticles();
        $aTmpList = array_reverse($aNoticeList, true);
        foreach (array_keys($aTmpList) as $iArticleId) {
            if (is_null($aTmpList[$iArticleId]->id)) {
                // check if the user has such an item on the list... if he does, no change
                $oItem = TdbShopUserNoticeList::GetNewInstance();
                /** @var $oItem TdbShopUserNoticeList */
                if (!$oItem->LoadFromFields(array('data_extranet_user_id' => $this->id, 'shop_article_id' => $iArticleId))) {
                    $aData = $aTmpList[$iArticleId]->sqlData;
                    $aData['data_extranet_user_id'] = $this->id;
                    $aTmpList[$iArticleId]->LoadFromRow($aData);
                    $aTmpList[$iArticleId]->AllowEditByAll(true);
                    $aTmpList[$iArticleId]->Save();
                }
            }
        }
        $this->aNoticeList = null;
        $this->GetNoticeListArticles();
        // remove items from cookie...
        $domain = TCMSSmartURLData::GetActive()->sOriginalDomainName;
        if ('www.' == substr($domain, 0, 4)) {
            $domain = substr($domain, 4);
        }
        setcookie(TdbDataExtranetUser::COOKIE_NAME_NOTICELIST, '', time() - 3600, '/', '.'.$domain, false, true);
    }
protected function PostLoginHookMergeTemporaryNoticeListWithDatabaseHistory()
    {
        // merge current notice list with existing notice list
        $aNoticeList = $this->GetNoticeListArticles();
        $aTmpList = array_reverse($aNoticeList, true);
        foreach (array_keys($aTmpList) as $iArticleId) {
            if (is_null($aTmpList[$iArticleId]->id)) {
                // check if the user has such an item on the list... if he does, no change
                $oItem = TdbShopUserNoticeList::GetNewInstance();
                /** @var $oItem TdbShopUserNoticeList */
                if (!$oItem->LoadFromFields(array('data_extranet_user_id' => $this->id, 'shop_article_id' => $iArticleId))) {
                    $aData = $aTmpList[$iArticleId]->sqlData;
                    $aData['data_extranet_user_id'] = $this->id;
                    $aTmpList[$iArticleId]->LoadFromRow($aData);
                    $aTmpList[$iArticleId]->AllowEditByAll(true);
                    $aTmpList[$iArticleId]->Save();
                }
            }
        }
        $this->aNoticeList = null;
        $this->GetNoticeListArticles();
        // remove items from cookie...
        $domain = TCMSSmartURLData::GetActive()->sOriginalDomainName;
        if ('www.' == substr($domain, 0, 4)) {
            $domain = substr($domain, 4);
        }
        setcookie(TdbDataExtranetUser::COOKIE_NAME_NOTICELIST, '', time() - 3600, '/', '.'.$domain, false, true);
    }
protected function PostLoginHookMergeTemporaryNoticeListWithDatabaseHistory ( ) { // merge current notice list with existing notice list $ aNoticeList = $ this -> GetNoticeListArticles ( ) ; $ aTmpList = array_reverse ( $ aNoticeList , true ) ; foreach ( array_keys ( $ aTmpList ) as $ iArticleId ) { if ( is_null ( $ aTmpList [ $ iArticleId ] -> id ) ) { // check if the user has such an item on the list... if he does, no change $ oItem = TdbShopUserNoticeList :: GetNewInstance ( ) ; /** @var $oItem TdbShopUserNoticeList */ if ( ! $ oItem -> LoadFromFields ( array ( 'data_extranet_user_id' => $ this -> id , 'shop_article_id' => $ iArticleId ) ) ) { $ aData = $ aTmpList [ $ iArticleId ] -> sqlData ; $ aData [ 'data_extranet_user_id' ] = $ this -> id ; $ aTmpList [ $ iArticleId ] -> LoadFromRow ( $ aData ) ; $ aTmpList [ $ iArticleId ] -> AllowEditByAll ( true ) ; $ aTmpList [ $ iArticleId ] -> Save ( ) ; } } } $ this -> aNoticeList = null ; $ this -> GetNoticeListArticles ( ) ; // remove items from cookie... $ domain = TCMSSmartURLData :: GetActive ( ) -> sOriginalDomainName ; if ( 'www.' == substr ( $ domain , 0 , 4 ) ) { $ domain = substr ( $ domain , 4 ) ; } setcookie ( TdbDataExtranetUser :: COOKIE_NAME_NOTICELIST , '' , time ( ) - 3600 , '/' , '.' . $ domain , false , true ) ; }
takes the notice list from session and merges it with the data
in the database. this is done when the user logs in to make the notice list permanent.
takes the notice list from session and merges it with the data in the database . this is done when the user logs in to make the notice list permanent .