src/ShopArticlePreorderBundle/objects/db/TPkgShopArticlePreorder.class.php
public function SaveNewPreorder($sArticleId = '')
    {
        // ------------------------------------------------------------------------
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->userDataExists('eMail') && TTools::IsValidEMail($oGlobal->GetuserData('eMail')) && !$oShopArticlePreorder = TdbShopArticlePreorder::LoadFromFields(array('shop_article_id' => $sArticleId, 'preorder_user_email' => $oGlobal->GetuserData('eMail')))) {
            $activePortal = $this->getPortalDomainService()->getActivePortal();
            $aPostData = array('shop_article_id' => $sArticleId, 'preorder_user_email' => $oGlobal->GetuserData('eMail'), 'preorder_date' => date('Y-m-d H:i:s'), 'cms_portal_id' => $activePortal->id);
            $this->LoadFromRow($aPostData);
            $this->AllowEditByAll(true);
            $this->Save();
            $this->AllowEditByAll(false);
            $oMsgManager->AddMessage('mail-preorder-form-eMail', 'SUCCESS-USER-SIGNUP-PREORDER-ARTICLE');

            return true;
        } else {
            if (!TTools::IsValidEMail($oGlobal->GetuserData('eMail'))) {
                $oMsgManager->AddMessage('mail-preorder-form-eMail', 'ERROR-E-MAIL-INVALID-INPUT');

                return false;
            } else {
                if ($oShopArticlePreorder = TdbShopArticlePreorder::LoadFromFields(array('shop_article_id' => $sArticleId, 'preorder_user_email' => $oGlobal->GetuserData('eMail')))) {
                    $oMsgManager->AddMessage('mail-preorder-form-eMail', 'ERROR-USER-SIGNUP-PREORDER-ARTICLE');

                    return false;
                } else {
                    return false;
                }
            }
        }
    }
public function SaveNewPreorder($sArticleId = '')
    {
        // ------------------------------------------------------------------------
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->userDataExists('eMail') && TTools::IsValidEMail($oGlobal->GetuserData('eMail')) && !$oShopArticlePreorder = TdbShopArticlePreorder::LoadFromFields(array('shop_article_id' => $sArticleId, 'preorder_user_email' => $oGlobal->GetuserData('eMail')))) {
            $activePortal = $this->getPortalDomainService()->getActivePortal();
            $aPostData = array('shop_article_id' => $sArticleId, 'preorder_user_email' => $oGlobal->GetuserData('eMail'), 'preorder_date' => date('Y-m-d H:i:s'), 'cms_portal_id' => $activePortal->id);
            $this->LoadFromRow($aPostData);
            $this->AllowEditByAll(true);
            $this->Save();
            $this->AllowEditByAll(false);
            $oMsgManager->AddMessage('mail-preorder-form-eMail', 'SUCCESS-USER-SIGNUP-PREORDER-ARTICLE');

            return true;
        } else {
            if (!TTools::IsValidEMail($oGlobal->GetuserData('eMail'))) {
                $oMsgManager->AddMessage('mail-preorder-form-eMail', 'ERROR-E-MAIL-INVALID-INPUT');

                return false;
            } else {
                if ($oShopArticlePreorder = TdbShopArticlePreorder::LoadFromFields(array('shop_article_id' => $sArticleId, 'preorder_user_email' => $oGlobal->GetuserData('eMail')))) {
                    $oMsgManager->AddMessage('mail-preorder-form-eMail', 'ERROR-USER-SIGNUP-PREORDER-ARTICLE');

                    return false;
                } else {
                    return false;
                }
            }
        }
    }
public function SaveNewPreorder ( $ sArticleId = '' ) { // ------------------------------------------------------------------------ $ oGlobal = TGlobal :: instance ( ) ; $ oMsgManager = TCMSMessageManager :: GetInstance ( ) ; if ( $ oGlobal -> userDataExists ( 'eMail' ) && TTools :: IsValidEMail ( $ oGlobal -> GetuserData ( 'eMail' ) ) && ! $ oShopArticlePreorder = TdbShopArticlePreorder :: LoadFromFields ( array ( 'shop_article_id' => $ sArticleId , 'preorder_user_email' => $ oGlobal -> GetuserData ( 'eMail' ) ) ) ) { $ activePortal = $ this -> getPortalDomainService ( ) -> getActivePortal ( ) ; $ aPostData = array ( 'shop_article_id' => $ sArticleId , 'preorder_user_email' => $ oGlobal -> GetuserData ( 'eMail' ) , 'preorder_date' => date ( 'Y-m-d H:i:s' ) , 'cms_portal_id' => $ activePortal -> id ) ; $ this -> LoadFromRow ( $ aPostData ) ; $ this -> AllowEditByAll ( true ) ; $ this -> Save ( ) ; $ this -> AllowEditByAll ( false ) ; $ oMsgManager -> AddMessage ( 'mail-preorder-form-eMail' , 'SUCCESS-USER-SIGNUP-PREORDER-ARTICLE' ) ; return true ; } else { if ( ! TTools :: IsValidEMail ( $ oGlobal -> GetuserData ( 'eMail' ) ) ) { $ oMsgManager -> AddMessage ( 'mail-preorder-form-eMail' , 'ERROR-E-MAIL-INVALID-INPUT' ) ; return false ; } else { if ( $ oShopArticlePreorder = TdbShopArticlePreorder :: LoadFromFields ( array ( 'shop_article_id' => $ sArticleId , 'preorder_user_email' => $ oGlobal -> GetuserData ( 'eMail' ) ) ) ) { $ oMsgManager -> AddMessage ( 'mail-preorder-form-eMail' , 'ERROR-USER-SIGNUP-PREORDER-ARTICLE' ) ; return false ; } else { return false ; } } } }
save new preorder to the DB.

@param string $sArticleId

@return bool
save new preorder to the DB .