当前位置: 首页>>代码示例>>PHP>>正文


PHP Website::getId方法代码示例

本文整理汇总了PHP中Magento\Store\Model\Website::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Website::getId方法的具体用法?PHP Website::getId怎么用?PHP Website::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Store\Model\Website的用法示例。


在下文中一共展示了Website::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLoadByCode

 /**
  * @magentoDbIsolation enabled
  */
 public function testLoadByCode()
 {
     $this->_model->load('admin');
     $this->assertEquals(0, $this->_model->getId());
     $this->assertEquals('admin', $this->_model->getCode());
     $this->assertEquals('Admin', $this->_model->getName());
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:10,代码来源:WebsiteTest.php

示例2: testLoad

 public function testLoad()
 {
     /* Test loading by id */
     $this->assertEquals(1, $this->_model->getId());
     $this->assertEquals('base', $this->_model->getCode());
     $this->assertEquals('Main Website', $this->_model->getName());
     /* Test loading by code */
     $this->_model->load('admin');
     $this->assertEquals(0, $this->_model->getId());
     $this->assertEquals('admin', $this->_model->getCode());
     $this->assertEquals('Admin', $this->_model->getName());
 }
开发者ID:aiesh,项目名称:magento2,代码行数:12,代码来源:WebsiteTest.php

示例3: getWebsites

 /**
  * Get loaded websites
  *
  * @param bool $withDefault
  * @param bool|string $codeKey
  * @return \Magento\Store\Model\Website[]
  */
 public function getWebsites($withDefault = false, $codeKey = false)
 {
     $websites = [];
     if ($withDefault) {
         $key = $codeKey ? $this->_website->getCode() : $this->_website->getId();
         $websites[$key] = $this->_website;
     }
     return $websites;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:DefaultStorage.php

示例4: aroundSave

 /**
  * Invalidate design config grid indexer on website creation
  *
  * @param StoreWebsite $subject
  * @param \Closure $proceed
  * @return StoreWebsite
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundSave(StoreWebsite $subject, \Closure $proceed)
 {
     $isObjectNew = $subject->getId() == 0;
     $result = $proceed();
     if ($isObjectNew) {
         $this->indexerRegistry->get(Config::DESIGN_CONFIG_GRID_INDEXER_ID)->invalidate();
     }
     return $result;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:17,代码来源:Website.php

示例5: clearWebsiteCache

 /**
  *  Unset website by id from app cache
  *
  * @param null|bool|int|string|Website $websiteId
  * @return void
  */
 public function clearWebsiteCache($websiteId = null)
 {
     if (is_null($websiteId)) {
         $websiteId = $this->getStore()->getWebsiteId();
     } elseif ($websiteId instanceof Website) {
         $websiteId = $websiteId->getId();
     } elseif ($websiteId === true) {
         $websiteId = $this->_website->getId();
     }
     if (!empty($this->_websites[$websiteId])) {
         $website = $this->_websites[$websiteId];
         unset($this->_websites[$website->getWebsiteId()]);
         unset($this->_websites[$website->getCode()]);
     }
 }
开发者ID:aiesh,项目名称:magento2,代码行数:21,代码来源:Db.php

示例6: addStockStatusToSelect

 /**
  * Add stock status to prepare index select
  *
  * @param \Magento\Framework\DB\Select $select
  * @param \Magento\Store\Model\Website $website
  * @return Status
  */
 public function addStockStatusToSelect(\Magento\Framework\DB\Select $select, \Magento\Store\Model\Website $website)
 {
     $websiteId = $website->getId();
     $select->joinLeft(['stock_status' => $this->getMainTable()], 'e.entity_id = stock_status.product_id AND stock_status.website_id=' . $websiteId, ['salable' => 'stock_status.stock_status']);
     return $this;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:Status.php

示例7: getId

 /**
  * {@inheritdoc}
  */
 public function getId()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getId');
     if (!$pluginInfo) {
         return parent::getId();
     } else {
         return $this->___callPlugins('getId', func_get_args(), $pluginInfo);
     }
 }
开发者ID:HaonanXu,项目名称:der-snack-backup,代码行数:12,代码来源:Interceptor.php

示例8: setWebsite

 /**
  * Set relation to the website
  *
  * @param Website $website
  * @return void
  */
 public function setWebsite(Website $website)
 {
     $this->setWebsiteId($website->getId());
 }
开发者ID:mrbadao,项目名称:magento-ce,代码行数:10,代码来源:Store.php

示例9: setWebsite

 /**
  * Set Website scope
  *
  * @param Website|int $website
  * @return $this
  */
 public function setWebsite($website)
 {
     $this->_website = $this->_storeManager->getWebsite($website);
     $this->addBindParam('scope_website_id', $this->_website->getId());
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:12,代码来源:Collection.php

示例10: isWebsiteSelected

 /**
  * @param \Magento\Store\Model\Website $website
  * @return bool
  */
 public function isWebsiteSelected(\Magento\Store\Model\Website $website)
 {
     return $this->getWebsiteId() === $website->getId() && $this->getStoreId() === null;
 }
开发者ID:koliaGI,项目名称:magento2,代码行数:8,代码来源:Switcher.php

示例11: afterGetDefault

 /**
  * @param \Magento\Store\Model\WebsiteRepository $subject
  * @param \Magento\Store\Model\Website $website
  * @return \Magento\Store\Model\Website
  */
 public function afterGetDefault(WebsiteRepository $subject, Website $website)
 {
     if (!$this->isNeededProcess()) {
         return $website;
     }
     if ($this->geoWebsite->getId() != $website->getId()) {
         $website = $subject->getById($this->geoWebsite->getId());
     }
     return $website;
 }
开发者ID:ytorbyk,项目名称:magento2-geo-store-switcher,代码行数:15,代码来源:GeoWebsiteRepository.php

示例12: getAcceptedSaveCookiesWebsiteIds

 /**
  * Return serialized list of accepted save cookie website
  *
  * @return string
  */
 public function getAcceptedSaveCookiesWebsiteIds()
 {
     $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites();
     $acceptedSaveCookiesWebsites[$this->_website->getId()] = 1;
     return json_encode($acceptedSaveCookiesWebsites);
 }
开发者ID:pavelnovitsky,项目名称:magento2,代码行数:11,代码来源:Cookie.php

示例13: getWebsiteId

 /**
  * Loads default website and returns its id
  *
  * @return int
  */
 public function getWebsiteId()
 {
     $this->loadStore();
     return $this->website->getId();
 }
开发者ID:ktplKunj,项目名称:TestMagento,代码行数:10,代码来源:StoreManager.php

示例14: _processWebsite

 /**
  * Process website info
  *
  * @param \Magento\Store\Model\System\Store $storeModel
  * @param \Magento\Store\Model\Website $website
  * @param string $section
  * @param string $curStore
  * @param string $curWebsite
  * @param array $options
  * @return array
  */
 protected function _processWebsite(\Magento\Store\Model\System\Store $storeModel, \Magento\Store\Model\Website $website, $section, $curStore, $curWebsite, array $options)
 {
     $websiteShow = false;
     foreach ($storeModel->getGroupCollection() as $group) {
         if ($group->getWebsiteId() != $website->getId()) {
             continue;
         }
         $groupShow = false;
         foreach ($storeModel->getStoreCollection() as $store) {
             if ($store->getGroupId() != $group->getId()) {
                 continue;
             }
             if (!$websiteShow) {
                 $websiteShow = true;
                 $options['website_' . $website->getCode()] = array('label' => $website->getName(), 'url' => $this->getUrl('*/*/*', array('section' => $section, 'website' => $website->getCode())), 'selected' => !$curStore && $curWebsite == $website->getCode(), 'style' => 'padding-left:16px; background:#DDD; font-weight:bold;');
             }
             if (!$groupShow) {
                 $groupShow = true;
                 $options['group_' . $group->getId() . '_open'] = array('is_group' => true, 'is_close' => false, 'label' => $group->getName(), 'style' => 'padding-left:32px;');
             }
             $options['store_' . $store->getCode()] = array('label' => $store->getName(), 'url' => $this->getUrl('*/*/*', array('section' => $section, 'website' => $website->getCode(), 'store' => $store->getCode())), 'selected' => $curStore == $store->getCode(), 'style' => '');
         }
         if ($groupShow) {
             $options['group_' . $group->getId() . '_close'] = array('is_group' => true, 'is_close' => true);
         }
     }
     return $options;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:39,代码来源:Switcher.php

示例15: getGuests

 /**
  * Get all not imported guests for a website.
  *
  * @param \Magento\Store\Model\Website $website
  *
  * @return $this
  */
 public function getGuests(\Magento\Store\Model\Website $website)
 {
     $guestCollection = $this->getCollection()->addFieldToFilter('is_guest', ['notnull' => true])->addFieldToFilter('email_imported', ['null' => true])->addFieldToFilter('website_id', $website->getId());
     return $guestCollection->load();
 }
开发者ID:dotmailer,项目名称:dotmailer-magento2-extension,代码行数:12,代码来源:Contact.php


注:本文中的Magento\Store\Model\Website::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。