本文整理匯總了PHP中Magento\Store\Model\Store::getWebsite方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getWebsite方法的具體用法?PHP Store::getWebsite怎麽用?PHP Store::getWebsite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Store\Model\Store
的用法示例。
在下文中一共展示了Store::getWebsite方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testSetGetWebsite
public function testSetGetWebsite()
{
$this->assertFalse($this->model->getWebsite());
$website = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getWebsite();
$this->model->setWebsite($website);
$actualResult = $this->model->getWebsite();
$this->assertSame($website, $actualResult);
}
示例2: testGetWebsiteDefault
/**
* Tests that getWebsite returns the default site when defaults are passed in for id
*/
public function testGetWebsiteDefault()
{
$this->assertFalse($this->_model->getWebsite());
$website = Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getWebsite();
$this->_model->setWebsite($website);
// Empty string should get treated like no parameter
$actualResult = $this->_model->getWebsite('');
$this->assertSame($website, $actualResult);
// Null string should get treated like no parameter
$actualResult = $this->_model->getWebsite(null);
$this->assertSame($website, $actualResult);
}
示例3: build
/**
* @param Store $store
* @return \NostoAccount
*/
public function build(Store $store)
{
$metaData = new \NostoAccount();
try {
$metaData->setTitle(implode(' - ', [$store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName()]));
$metaData->setName(substr(sha1(rand()), 0, 8));
$metaData->setFrontPageUrl(\NostoHttpRequest::replaceQueryParamInUrl('___store', $store->getCode(), $store->getBaseUrl(UrlInterface::URL_TYPE_WEB)));
$metaData->setCurrency(new \NostoCurrencyCode($store->getBaseCurrencyCode()));
$lang = substr($store->getConfig('general/locale/code'), 0, 2);
$metaData->setLanguage(new \NostoLanguageCode($lang));
$lang = substr($this->_localeResolver->getLocale(), 0, 2);
$metaData->setOwnerLanguage(new \NostoLanguageCode($lang));
$owner = $this->_accountOwnerMetaBuilder->build();
$metaData->setOwner($owner);
$billing = $this->_accountBillingMetaBuilder->build($store);
$metaData->setBilling($billing);
} catch (\NostoException $e) {
$this->_logger->error($e, ['exception' => $e]);
}
return $metaData;
}
示例4: setStore
/**
* Set store to customer
*
* @param \Magento\Store\Model\Store $store
* @return $this
*/
public function setStore(\Magento\Store\Model\Store $store)
{
$this->setStoreId($store->getId());
$this->setWebsiteId($store->getWebsite()->getId());
return $this;
}
示例5: getWebsite
/**
* {@inheritdoc}
*/
public function getWebsite()
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getWebsite');
if (!$pluginInfo) {
return parent::getWebsite();
} else {
return $this->___callPlugins('getWebsite', func_get_args(), $pluginInfo);
}
}