本文整理匯總了PHP中Magento\Store\Model\Store::setWebsite方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::setWebsite方法的具體用法?PHP Store::setWebsite怎麽用?PHP Store::setWebsite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Store\Model\Store
的用法示例。
在下文中一共展示了Store::setWebsite方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: setWebsite
/**
* {@inheritdoc}
*/
public function setWebsite(\Magento\Store\Model\Website $website)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'setWebsite');
if (!$pluginInfo) {
return parent::setWebsite($website);
} else {
return $this->___callPlugins('setWebsite', func_get_args(), $pluginInfo);
}
}