當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Store::getCode方法代碼示例

本文整理匯總了PHP中Magento\Store\Model\Store::getCode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getCode方法的具體用法?PHP Store::getCode怎麽用?PHP Store::getCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Store\Model\Store的用法示例。


在下文中一共展示了Store::getCode方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCode

 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCode');
     if (!$pluginInfo) {
         return parent::getCode();
     } else {
         return $this->___callPlugins('getCode', func_get_args(), $pluginInfo);
     }
 }
開發者ID:HaonanXu,項目名稱:der-snack-backup,代碼行數:12,代碼來源:Interceptor.php

示例2: getStoreConfig

 /**
  * @param \Magento\Store\Model\Store $store
  * @return \Magento\Store\Api\Data\StoreConfigInterface
  */
 protected function getStoreConfig($store)
 {
     /** @var \Magento\Store\Model\Data\StoreConfig $storeConfig */
     $storeConfig = $this->storeConfigFactory->create();
     $storeConfig->setId($store->getId())->setCode($store->getCode())->setWebsiteId($store->getWebsiteId());
     foreach ($this->configPaths as $methodName => $configPath) {
         $configValue = $this->scopeConfig->getValue($configPath, \Magento\Store\Model\ScopeInterface::SCOPE_STORES, $store->getCode());
         $storeConfig->{$methodName}($configValue);
     }
     $storeConfig->setBaseUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB, false));
     $storeConfig->setSecureBaseUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB, true));
     $storeConfig->setBaseLinkUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK, false));
     $storeConfig->setSecureBaseLinkUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK, true));
     $storeConfig->setBaseStaticUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_STATIC, false));
     $storeConfig->setSecureBaseStaticUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_STATIC, true));
     $storeConfig->setBaseMediaUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA, false));
     $storeConfig->setSecureBaseMediaUrl($store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA, true));
     return $storeConfig;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:23,代碼來源:StoreConfigManager.php

示例3: build

 /**
  * @param Store $store
  * @param \NostoAccount $account
  * @return \NostoOauth
  */
 public function build(Store $store, \NostoAccount $account = null)
 {
     $metaData = new \NostoOauth();
     try {
         $metaData->setScopes(\NostoApiToken::getApiTokenNames());
         $redirectUrl = $this->_urlBuilder->getUrl('nosto/oauth', ['_nosid' => true, '_scope_to_url' => true, '_scope' => $store->getCode()]);
         $metaData->setRedirectUrl($redirectUrl);
         $lang = substr($this->_localeResolver->getLocale(), 0, 2);
         $metaData->setLanguage(new \NostoLanguageCode($lang));
         if (!is_null($account)) {
             $metaData->setAccount($account);
         }
     } catch (\NostoException $e) {
         $this->_logger->error($e, ['exception' => $e]);
     }
     return $metaData;
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:22,代碼來源:Builder.php

示例4: getTargetStorePostData

 /**
  * Returns target store post data
  *
  * @param \Magento\Store\Model\Store $store
  * @return string
  */
 public function getTargetStorePostData(\Magento\Store\Model\Store $store)
 {
     return $this->_postDataHelper->getPostData($this->getHomeUrl(), ['___store' => $store->getCode(), '___from_store' => $this->getStoreCode()]);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:10,代碼來源:Switcher.php

示例5: getPreviewUrlFront

 /**
  * Gets the absolute preview URL to the given store's front page.
  * The preview url includes "nostodebug=true" parameter.
  *
  * @param Store $store the store to get the url for.
  *
  * @return string the url.
  */
 public function getPreviewUrlFront(Store $store)
 {
     $url = $this->_urlBuilder->getUrl('', array('_nosid' => true, '_scope_to_url' => true, '_scope' => $store->getCode()));
     return $this->addNostoDebugParamToUrl($url);
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:13,代碼來源:Url.php

示例6: getTargetStorePostData

 /**
  * Returns target store post data
  *
  * @param \Magento\Store\Model\Store $store
  * @param array $data
  * @return string
  */
 public function getTargetStorePostData(\Magento\Store\Model\Store $store, $data = [])
 {
     $data[\Magento\Store\Api\StoreResolverInterface::PARAM_NAME] = $store->getCode();
     return $this->_postDataHelper->getPostData($this->getUrl('stores/store/switch'), $data);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:12,代碼來源:Switcher.php

示例7: buildUrl

 /**
  * @param Product $product
  * @param Store $store
  * @return string
  */
 protected function buildUrl(Product $product, Store $store)
 {
     return $product->getUrlInStore(['_ignore_category' => true, '_nosid' => true, '_scope_to_url' => true, '_scope' => $store->getCode()]);
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:9,代碼來源:Builder.php


注:本文中的Magento\Store\Model\Store::getCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。