本文整理匯總了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);
}
}
示例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;
}
示例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;
}
示例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()]);
}
示例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);
}
示例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);
}
示例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()]);
}