• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP oxNew函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中oxNew函数的典型用法代码示例。如果您正苦于以下问题:PHP oxNew函数的具体用法?PHP oxNew怎么用?PHP oxNew使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了oxNew函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: addPayToSet

 /**
  * Adds this payments to this set
  */
 public function addPayToSet()
 {
     $aChosenSets = $this->_getActionIds('oxpayments.oxid');
     $soxId = $this->getConfig()->getRequestParameter('synchoxid');
     // adding
     if ($this->getConfig()->getRequestParameter('all')) {
         $sPayTable = $this->_getViewName('oxpayments');
         $aChosenSets = $this->_getAll($this->_addFilter("select {$sPayTable}.oxid " . $this->_getQuery()));
     }
     if ($soxId && $soxId != "-1" && is_array($aChosenSets)) {
         $oDb = oxDb::getDb();
         foreach ($aChosenSets as $sChosenSet) {
             // check if we have this entry already in
             $sID = $oDb->getOne("select oxid from oxobject2payment where oxpaymentid = " . $oDb->quote($sChosenSet) . "  and oxobjectid = " . $oDb->quote($soxId) . " and oxtype = 'oxdelset'", false, false);
             if (!isset($sID) || !$sID) {
                 $oObject = oxNew('oxbase');
                 $oObject->init('oxobject2payment');
                 $oObject->oxobject2payment__oxpaymentid = new oxField($sChosenSet);
                 $oObject->oxobject2payment__oxobjectid = new oxField($soxId);
                 $oObject->oxobject2payment__oxtype = new oxField("oxdelset");
                 $oObject->save();
             }
         }
     }
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:28,代码来源:deliveryset_payment_ajax.php


示例2: getEntryUri

 /**
  * Returns seo uri
  *
  * @return string
  */
 public function getEntryUri()
 {
     $oContent = oxNew('oxcontent');
     if ($oContent->load($this->getEditObjectId())) {
         return $this->_getEncoder()->getContentUri($oContent, $this->getEditLang());
     }
 }
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:12,代码来源:content_seo.php


示例3: render

 /**
  * Collects article crosselling and attributes information, passes
  * them to Smarty engine and returns name or template file
  * "article_crossselling.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     // crossselling
     $this->_createCategoryTree("artcattree");
     // accessoires
     $this->_createCategoryTree("artcattree2");
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oArticleCrossellingAjax = oxNew('article_crossselling_ajax');
         $this->_aViewData['oxajax'] = $oArticleCrossellingAjax->getColumns();
         return "popups/article_crossselling.tpl";
     } elseif ($iAoc == 2) {
         $oArticleAccessoriesAjax = oxNew('article_accessories_ajax');
         $this->_aViewData['oxajax'] = $oArticleAccessoriesAjax->getColumns();
         return "popups/article_accessories.tpl";
     }
     return "article_crossselling.tpl";
 }
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:35,代码来源:article_crossselling.php


示例4: render

 /**
  * Executes parent method parent::render(), creates deliveryset category tree,
  * passes data to Smarty engine and returns name of template file "deliveryset_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     $sTheme = $this->_sTheme = $this->getEditObjectId();
     $sShopId = $myConfig->getShopId();
     if (!isset($sTheme)) {
         $sTheme = $this->_sTheme = $this->getConfig()->getConfigParam('sTheme');
     }
     $oTheme = oxNew('oxTheme');
     if ($oTheme->load($sTheme)) {
         $this->_aViewData["oTheme"] = $oTheme;
         try {
             $aDbVariables = $this->loadConfVars($sShopId, $this->_getModuleForConfigVars());
             $this->_aViewData["var_constraints"] = $aDbVariables['constraints'];
             $this->_aViewData["var_grouping"] = $aDbVariables['grouping'];
             foreach ($this->_aConfParams as $sType => $sParam) {
                 $this->_aViewData[$sParam] = $aDbVariables['vars'][$sType];
             }
         } catch (oxException $oEx) {
             oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx);
             $oEx->debugOut();
         }
     } else {
         oxRegistry::get("oxUtilsView")->addErrorToDisplay(oxNew("oxException", 'EXCEPTION_THEME_NOT_LOADED'));
     }
     return 'theme_config.tpl';
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:33,代码来源:theme_config.php


示例5: __construct

 /**
  * Sets dependencies.
  *
  * @param oxRequiredFieldValidator $oFieldValidator
  */
 public function __construct($oFieldValidator = null)
 {
     if (is_null($oFieldValidator)) {
         $oFieldValidator = oxNew('oxRequiredFieldValidator');
     }
     $this->setFieldValidator($oFieldValidator);
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:12,代码来源:oxrequiredfieldsvalidator.php


示例6: render

 /**
  * Collects article attributes and selection lists, passes them to Smarty engine,
  * returns name of template file "article_attribute.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData["readonly"] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_attribute.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_attribute.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_selection.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_selection.tpl";
     }
     return "article_attribute.tpl";
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:31,代码来源:article_attribute.php


示例7: _getFileManger

 protected function _getFileManger()
 {
     if (is_null($this->_oFileManger)) {
         $this->_oFileManger = oxNew('fileManager');
     }
     return $this->_oFileManger;
 }
开发者ID:OXIDprojects,项目名称:debugax,代码行数:7,代码来源:chromephpmanager.php


示例8: getPayPalConfig

 /**
  * Return PayPal config
  *
  * @return oePayPalConfig
  */
 public function getPayPalConfig()
 {
     if (is_null($this->_oPayPalConfig)) {
         $this->setPayPalConfig(oxNew('oePayPalConfig'));
     }
     return $this->_oPayPalConfig;
 }
开发者ID:Juergen-Busch,项目名称:paypal,代码行数:12,代码来源:oepaypalcontroller.php


示例9: _getStateObject

 /**
  * Returns oxState object
  *
  * @return oxState
  */
 protected function _getStateObject()
 {
     if (is_null($this->_oStateObject)) {
         $this->_oStateObject = oxNew('oxState');
     }
     return $this->_oStateObject;
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:12,代码来源:Address.php


示例10: render

 /**
  * Executes parent method parent::render()
  * passes data to Smarty engine and returns name of template file "deliveryset_payment.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->setLanguage($this->_iEditLang);
         $odeliveryset->load($soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->setLanguage(key($oOtherLang));
             $odeliveryset->load($soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         //Disable editing for derived articles
         if ($odeliveryset->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/deliveryset_payment.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_payment.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/deliveryset_country.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_country.tpl";
     }
     return "deliveryset_payment.tpl";
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:40,代码来源:deliveryset_payment.php


示例11: _getStrHandler

 /**
  * Non static getter returning str handler. The sense of getStr() and _getStrHandler() is
  * to be possible to call this method statically ( oxStr::getStr() ), yet leaving the
  * possibility to extend it in modules by overriding _getStrHandler() method.
  *
  * @return object
  */
 protected function _getStrHandler()
 {
     if (oxRegistry::getConfig()->isUtf() && function_exists('mb_strlen')) {
         return oxNew("oxStrMb");
     }
     return oxNew("oxStrRegular");
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:14,代码来源:oxstr.php


示例12: render

 /**
  * Executes parent method parent::render(), creates oxpricealarm object
  * and passes it's data to Smarty engine. Returns name of template file
  * "pricealarm_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $config = $this->getConfig();
     parent::render();
     $shopId = $config->getShopId();
     //articles price in subshop and baseshop can be different
     $this->_aViewData['iAllCnt'] = 0;
     $query = "\n            SELECT oxprice, oxartid\n            FROM oxpricealarm\n            WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '{$shopId}' ";
     $result = oxDb::getDb()->select($query);
     if ($result != false && $result->count() > 0) {
         $simpleCache = array();
         while (!$result->EOF) {
             $price = $result->fields[0];
             $articleId = $result->fields[1];
             if (isset($simpleCache[$articleId])) {
                 if ($simpleCache[$articleId] <= $price) {
                     $this->_aViewData['iAllCnt'] += 1;
                 }
             } else {
                 $article = oxNew("oxArticle");
                 if ($article->load($articleId)) {
                     $articlePrice = $simpleCache[$articleId] = $article->getPrice()->getBruttoPrice();
                     if ($articlePrice <= $price) {
                         $this->_aViewData['iAllCnt'] += 1;
                     }
                 }
             }
             $result->fetchRow();
         }
     }
     return "pricealarm_mail.tpl";
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:39,代码来源:PriceAlarmMail.php


示例13: _prepareTag

 /**
  * Prepares tag for search in db
  *
  * @param string $sTag tag to prepare
  *
  * @return string
  */
 protected function _prepareTag($sTag)
 {
     if ($this->_oTagPrepareUtil == null) {
         $this->_oTagPrepareUtil = oxNew('oxtagcloud');
     }
     return $sTag = $this->_oTagPrepareUtil->prepareTags($sTag);
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:14,代码来源:oxseoencodertag.php


示例14: request_product

 public function request_product()
 {
     $myConfig = $this->getConfig();
     $myUtils = oxRegistry::getUtils();
     //control captcha
     $sMac = oxRegistry::getConfig()->getRequestParameter('c_mac');
     $sMacHash = oxRegistry::getConfig()->getRequestParameter('c_mach');
     $oCaptcha = $this->getCaptcha();
     if (!$oCaptcha->pass($sMac, $sMacHash)) {
         oxRegistry::get("oxUtilsView")->addErrorToDisplay('MESSAGE_WRONG_VERIFICATION_CODE');
         return;
     }
     /** @var oxMailValidator $oMailValidator */
     $oMailValidator = oxNew('oxMailValidator');
     $aParams = oxRegistry::getConfig()->getRequestParameter('pa');
     if (!isset($aParams['email']) || !$oMailValidator->isValidEmail($aParams['email'])) {
         oxRegistry::get("oxUtilsView")->addErrorToDisplay('MESSAGE_INVALID_EMAIL');
         return;
     }
     $aParams['aid'] = $this->getProduct()->getId();
     $oArticleRequest = oxNew("psarticlerequest");
     $oArticleRequest->psarticlerequest__oxuserid = new oxField(oxRegistry::getSession()->getVariable('usr'));
     $oArticleRequest->psarticlerequest__oxemail = new oxField($aParams['email']);
     $oArticleRequest->psarticlerequest__oxartid = new oxField($aParams['aid']);
     $oArticleRequest->psarticlerequest__oxshopid = new oxField($myConfig->getShopId());
     $oArticleRequest->psarticlerequest__oxlang = new oxField(oxRegistry::getLang()->getBaseLanguage());
     $oArticleRequest->psarticlerequest__oxstatus = new oxField(psArticleRequest::STATUS_RECEIVED);
     $oArticleRequest->save();
     $oEmail = oxNew("oxEmail");
     $oEmail->sendArticleRequestNotification($aParams, $oArticleRequest);
     $this->_iArticleRequestStatus = 1;
     oxRegistry::get("oxUtilsView")->addErrorToDisplay('PS_ARTICLEREQUEST_SUCCESS');
 }
开发者ID:HFranz,项目名称:psArticleRequest,代码行数:33,代码来源:psarticlerequest_details.php


示例15: genViews

 /**
  * Generate DB views
  */
 public static function genViews()
 {
     $oShop = oxNew('oxShop');
     if ($oShop->load(oxRegistry::getConfig()->getShopId())) {
         $oShop->generateViews();
     }
 }
开发者ID:proudcommerce,项目名称:psHiddenArticles,代码行数:10,代码来源:pshiddenarticles_setup.php


示例16: save

 /**
  * Saves category description text to DB.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $myConfig = $this->getConfig();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     $oCategory = oxNew("oxCategory");
     $iCatLang = oxRegistry::getConfig()->getRequestParameter("catlang");
     $iCatLang = $iCatLang ? $iCatLang : 0;
     if ($soxId != "-1") {
         $oCategory->loadInLang($iCatLang, $soxId);
     } else {
         $aParams['oxcategories__oxid'] = null;
     }
     //Disable editing for derived items
     if ($oCategory->isDerived()) {
         return;
     }
     $oCategory->setLanguage(0);
     $oCategory->assign($aParams);
     $oCategory->setLanguage($iCatLang);
     $oCategory->save();
     // set oxid if inserted
     $this->setEditObjectId($oCategory->getId());
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:30,代码来源:CategoryText.php


示例17: render

 /**
  * Executes parent method parent::render() and returns name of template
  * file "shop_list.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != self::NEW_SHOP_ID) {
         // load object
         $oShop = oxNew('oxShop');
         if (!$oShop->load($soxId)) {
             $soxId = $myConfig->getBaseShopId();
             $oShop->load($soxId);
         }
         $this->_aViewData['editshop'] = $oShop;
     }
     // default page number 1
     $this->_aViewData['default_edit'] = 'shop_main';
     $this->_aViewData['updatemain'] = $this->_blUpdateMain;
     $this->updateNavigation();
     if ($this->_aViewData['updatenav']) {
         //skipping requirements checking when reloading nav frame
         oxRegistry::getSession()->setVariable("navReload", true);
     }
     //making sure we really change shops on low level
     if ($soxId && $soxId != self::NEW_SHOP_ID) {
         $myConfig->setShopId($soxId);
         oxRegistry::getSession()->setVariable('currentadminshop', $soxId);
     }
     return 'shop_list.tpl';
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:35,代码来源:ShopList.php


示例18: getExpectedRequest

 /**
  * Returns formed request which should be returned during testing.
  *
  * @return oxOnlineModulesNotifierRequest
  */
 protected function getExpectedRequest()
 {
     $oRequest = oxNew('oxOnlineModulesNotifierRequest');
     $sShopUrl = $this->getConfig()->getShopUrl();
     $oRequest->edition = $this->getConfig()->getEdition();
     $oRequest->version = $this->getConfig()->getVersion();
     $oRequest->shopUrl = $sShopUrl;
     $oRequest->pVersion = '1.1';
     $oRequest->productId = 'eShop';
     $modules = new stdClass();
     $modules->module = array();
     $aModulesInfo = array();
     $aModulesInfo[] = array('id' => 'extending_1_class', 'version' => '1.0', 'activeInShop' => array($sShopUrl));
     $aModulesInfo[] = array('id' => 'extending_1_class_3_extensions', 'version' => '1.0', 'activeInShop' => array($sShopUrl));
     $aModulesInfo[] = array('id' => 'extending_3_blocks', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'extending_3_classes', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'extending_3_classes_with_1_extension', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'no_extending', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_1_extension', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_2_files', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_2_settings', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_2_templates', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_events', 'version' => '1.0', 'activeInShop' => array());
     $aModulesInfo[] = array('id' => 'with_everything', 'version' => '1.0', 'activeInShop' => array($sShopUrl));
     foreach ($aModulesInfo as $aModuleInfo) {
         $module = new stdClass();
         $module->id = $aModuleInfo['id'];
         $module->version = $aModuleInfo['version'];
         $module->activeInShops = new stdClass();
         $module->activeInShops->activeInShop = $aModuleInfo['activeInShop'];
         $modules->module[] = $module;
     }
     $oRequest->modules = $modules;
     return $oRequest;
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:40,代码来源:onlinemodulenotifierTest.php


示例19: render

 /**
  * Checks if given token is valid, formats HTTP headers,
  * and outputs file to buffer.
  *
  * If token is not valid, redirects to start page.
  */
 public function render()
 {
     $sFileOrderId = oxRegistry::getConfig()->getRequestParameter('sorderfileid');
     if ($sFileOrderId) {
         $oArticleFile = oxNew('oxFile');
         try {
             /** @var oxOrderFile $oOrderFile */
             $oOrderFile = oxNew('oxOrderFile');
             if ($oOrderFile->load($sFileOrderId)) {
                 $sFileId = $oOrderFile->getFileId();
                 $blLoadedAndExists = $oArticleFile->load($sFileId) && $oArticleFile->exist();
                 if ($sFileId && $blLoadedAndExists && $oOrderFile->processOrderFile()) {
                     $oArticleFile->download();
                 } else {
                     $sError = "ERROR_MESSAGE_FILE_DOESNOT_EXIST";
                 }
             }
         } catch (\OxidEsales\EshopCommunity\Core\Exception\StandardException $oEx) {
             $sError = "ERROR_MESSAGE_FILE_DOWNLOAD_FAILED";
         }
     } else {
         $sError = "ERROR_MESSAGE_WRONG_DOWNLOAD_LINK";
     }
     if ($sError) {
         $oEx = new oxExceptionToDisplay();
         $oEx->setMessage($sError);
         oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx, false);
         oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getShopUrl() . 'index.php?cl=account_downloads');
     }
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:36,代码来源:DownloadController.php


示例20: oeThemeSwitcherGetUserAgent

 /**
  * User Agent getter.
  *
  * @return oeThemeSwitcherUserAgent
  */
 public function oeThemeSwitcherGetUserAgent()
 {
     if (is_null($this->_oUserAgent)) {
         $this->_oUserAgent = oxNew('oeThemeSwitcherUserAgent');
     }
     return $this->_oUserAgent;
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:12,代码来源:oethemeswitcherviewconfig.php



注:本文中的oxNew函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP oxRemClassModule函数代码示例发布时间:2022-05-15
下一篇:
PHP oxAddClassModule函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap