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


PHP Store::getWebsite方法代碼示例

本文整理匯總了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);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:8,代碼來源:StoreTest.php

示例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);
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:15,代碼來源:GroupTest.php

示例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;
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:25,代碼來源:Builder.php

示例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;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:12,代碼來源:Customer.php

示例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);
     }
 }
開發者ID:HaonanXu,項目名稱:der-snack-backup,代碼行數:12,代碼來源:Interceptor.php


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