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


PHP Store::getId方法代碼示例

本文整理匯總了PHP中Magento\Store\Model\Store::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getId方法的具體用法?PHP Store::getId怎麽用?PHP Store::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Store\Model\Store的用法示例。


在下文中一共展示了Store::getId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: saveCfgForRussian

 private function saveCfgForRussian($path, $value)
 {
     $entity = Cfg::ENTITY_MAGE_CORE_CONFIG_DATA;
     $stoerViewId = $this->storeRussianRu->getId();
     $bind = [Cfg::E_CONFIG_A_SCOPE => Cfg::SCOPE_CFG_STORES, Cfg::E_CONFIG_A_SCOPE_ID => $stoerViewId, Cfg::E_CONFIG_A_PATH => $path, Cfg::E_CONFIG_A_VALUE => $value];
     $this->repoGeneric->replaceEntity($entity, $bind);
 }
開發者ID:praxigento,項目名稱:mobi_app_generic_mage2,代碼行數:7,代碼來源:Stocks.php

示例2: getCollection

 /**
  * @inheritdoc
  */
 protected function getCollection(Store $store)
 {
     /** @var \Magento\Sales\Model\ResourceModel\Order\Collection $collection */
     $collection = $this->_orderCollectionFactory->create();
     $collection->addAttributeToFilter('store_id', ['eq' => $store->getId()]);
     return $collection;
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:10,代碼來源:Order.php

示例3: getLogoImage

 /**
  * Get logo image
  *
  * @param \Magento\Store\Model\Store $store
  * @return string|null
  */
 public function getLogoImage($store)
 {
     $image = null;
     if (null !== $store) {
         $image = basename($this->_scopeConfig->getValue('design/header/logo_src', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store->getId()));
     }
     return $image;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:14,代碼來源:LogoUploader.php

示例4: beforeGetTargetStorePostData

 /**
  * Set redirect url for store view based on request path info
  *
  * @param \Magento\Store\Block\Switcher $switcher
  * @param \Magento\Store\Model\Store $store
  * @param array $data
  * @return array
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function beforeGetTargetStorePostData(\Magento\Store\Block\Switcher $switcher, \Magento\Store\Model\Store $store, $data = [])
 {
     $urlRewrite = $this->urlFinder->findOneByData([UrlRewrite::TARGET_PATH => $this->trimSlashInPath($this->request->getPathInfo()), UrlRewrite::STORE_ID => $store->getId()]);
     if ($urlRewrite) {
         $data[ActionInterface::PARAM_NAME_URL_ENCODED] = $this->urlHelper->getEncodedUrl($this->trimSlashInPath($this->urlBuilder->getUrl($urlRewrite->getRequestPath())));
     }
     return [$store, $data];
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:17,代碼來源:SetRedirectUrl.php

示例5: clearIndex

 /**
  * @param \Magento\Store\Model\Store $store
  * @return void
  */
 private function clearIndex(\Magento\Store\Model\Store $store)
 {
     $dimensions = [$this->dimensionFactory->create(['name' => 'scope', 'value' => $store->getId()])];
     $configData = $this->indexerConfig->getIndexer(FulltextIndexer::INDEXER_ID);
     /** @var \Magento\CatalogSearch\Model\Indexer\IndexerHandler $indexHandler */
     $indexHandler = $this->indexerHandlerFactory->create(['data' => $configData]);
     $indexHandler->cleanIndex($dimensions);
 }
開發者ID:nja78,項目名稱:magento2,代碼行數:12,代碼來源:Store.php

示例6: aroundSave

 /**
  * Invalidate design config grid indexer on store creation
  *
  * @param StoreStore $subject
  * @param \Closure $proceed
  * @return StoreStore
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundSave(StoreStore $subject, \Closure $proceed)
 {
     $isObjectNew = $subject->getId() == 0;
     $result = $proceed();
     if ($isObjectNew) {
         $this->indexerRegistry->get(Config::DESIGN_CONFIG_GRID_INDEXER_ID)->invalidate();
     }
     return $result;
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:17,代碼來源:Store.php

示例7: getCollection

 /**
  * @inheritdoc
  */
 protected function getCollection(Store $store)
 {
     /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
     $collection = $this->_productCollectionFactory->create();
     $collection->setVisibility($this->_productVisibility->getVisibleInSiteIds());
     $collection->addAttributeToFilter('status', ['eq' => '1']);
     $collection->addStoreFilter($store->getId());
     return $collection;
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:12,代碼來源:Product.php

示例8: getRequestPathByIdPath

 /**
  * Retrieve request_path using id_path and current store's id.
  *
  * @param string $idPath
  * @param int|\Magento\Store\Model\Store $store
  * @return string
  */
 public function getRequestPathByIdPath($idPath, $store)
 {
     if ($store instanceof \Magento\Store\Model\Store) {
         $storeId = (int) $store->getId();
     } else {
         $storeId = (int) $store;
     }
     $select = $this->_getReadAdapter()->select();
     /** @var $select \Magento\Framework\DB\Select */
     $select->from(array('main_table' => $this->getMainTable()), 'request_path')->where('main_table.store_id = :store_id')->where('main_table.id_path = :id_path')->limit(1);
     $bind = array('store_id' => $storeId, 'id_path' => $idPath);
     return $this->_getReadAdapter()->fetchOne($select, $bind);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:20,代碼來源:UrlRewrite.php

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

示例10: addStoreFilter

 /**
  * Add store filter to collection
  * @param array|int|\Magento\Store\Model\Store  $store
  * @param boolean $withAdmin
  * @return $this
  */
 public function addStoreFilter($store, $withAdmin = true)
 {
     if ($store === null) {
         return $this;
     }
     if (!$this->getFlag('store_filter_added')) {
         if ($store instanceof \Magento\Store\Model\Store) {
             $this->_storeId = $store->getId();
             $store = [$store->getId()];
         }
         if (!is_array($store)) {
             $this->_storeId = $store;
             $store = [$store];
         }
         if (in_array(\Magento\Store\Model\Store::DEFAULT_STORE_ID, $store)) {
             return $this;
         }
         if ($withAdmin) {
             $store[] = \Magento\Store\Model\Store::DEFAULT_STORE_ID;
         }
         $this->addFilter('store', ['in' => $store], 'public');
     }
     return $this;
 }
開發者ID:magefan,項目名稱:module-blog,代碼行數:30,代碼來源:Collection.php

示例11: 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

示例12: getChooseFromStoreHtml

 /**
  * Get HTML of store chooser
  *
  * @param \Magento\Store\Model\Store $storeTo
  * @return string
  */
 public function getChooseFromStoreHtml($storeTo)
 {
     if (!$this->_storeFromHtml) {
         $this->_storeFromHtml = '<select ' . 'class="admin__control-select" ' . 'name="copy_to_stores[__store_identifier__]" ' . 'disabled="disabled">';
         $this->_storeFromHtml .= '<option value="0">' . __('Default Values') . '</option>';
         foreach ($this->getWebsiteCollection() as $_website) {
             if (!$this->hasWebsite($_website->getId())) {
                 continue;
             }
             $optGroupLabel = $this->escapeHtml($_website->getName());
             $this->_storeFromHtml .= '<optgroup label="' . $optGroupLabel . '"></optgroup>';
             foreach ($this->getGroupCollection($_website) as $_group) {
                 $optGroupName = $this->escapeHtml($_group->getName());
                 $this->_storeFromHtml .= '<optgroup label="&nbsp;&nbsp;&nbsp;&nbsp;' . $optGroupName . '">';
                 foreach ($this->getStoreCollection($_group) as $_store) {
                     $this->_storeFromHtml .= '<option value="' . $_store->getId() . '">&nbsp;&nbsp;&nbsp;&nbsp;';
                     $this->_storeFromHtml .= $this->escapeHtml($_store->getName()) . '</option>';
                 }
             }
             $this->_storeFromHtml .= '</optgroup>';
         }
         $this->_storeFromHtml .= '</select>';
     }
     return str_replace('__store_identifier__', $storeTo->getId(), $this->_storeFromHtml);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:31,代碼來源:Websites.php

示例13: getTableNameByStore

 /**
  * Return index table name
  *
  * @param \Magento\Store\Model\Store $store
  * @param bool $useTempTable
  * @return string
  */
 protected function getTableNameByStore(\Magento\Store\Model\Store $store, $useTempTable)
 {
     $tableName = $this->getMainStoreTable($store->getId());
     return $useTempTable ? $this->addTemporaryTableSuffix($tableName) : $tableName;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:12,代碼來源:Rows.php

示例14: isStoreSelected

 /**
  * @param \Magento\Store\Model\Store $store
  * @return bool
  */
 public function isStoreSelected(\Magento\Store\Model\Store $store)
 {
     return $this->getStoreId() !== null && (int) $this->getStoreId() === (int) $store->getId();
 }
開發者ID:koliaGI,項目名稱:magento2,代碼行數:8,代碼來源:Switcher.php

示例15: getStoreId

 /**
  * Loads default store view and returns its id
  *
  * @return int
  */
 public function getStoreId()
 {
     $this->loadStore();
     return $this->store->getId();
 }
開發者ID:ktplKunj,項目名稱:TestMagento,代碼行數:10,代碼來源:StoreManager.php


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