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


PHP Store::getStoresStructure方法代码示例

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


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

示例1: prepareItem

 /**
  * Get data
  *
  * @param array $item
  * @return string
  */
 protected function prepareItem(array $item)
 {
     $content = '';
     $origStores = $item['store_id'];
     if (empty($origStores)) {
         return '';
     }
     if (!is_array($origStores)) {
         $origStores = [$origStores];
     }
     if (in_array(0, $origStores) && count($origStores) == 1) {
         return __('All Store Views');
     }
     $data = $this->systemStore->getStoresStructure(false, $origStores);
     foreach ($data as $website) {
         $content .= $website['label'] . "<br/>";
         foreach ($website['children'] as $group) {
             $content .= str_repeat('&nbsp;', 3) . $this->escaper->escapeHtml($group['label']) . "<br/>";
             foreach ($group['children'] as $store) {
                 $content .= str_repeat('&nbsp;', 6) . $this->escaper->escapeHtml($store['label']) . "<br/>";
             }
         }
     }
     return $content;
 }
开发者ID:nja78,项目名称:magento2,代码行数:31,代码来源:Store.php

示例2: testGetStoresStructure

 /**
  * @dataProvider getStoresStructureDataProvider
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function testGetStoresStructure($isAll, $storeId, $groupId, $websiteId, $storeName, $groupName, $websiteName, $storeIds, $groupIds, $websiteIds, $expectedResult)
 {
     $this->websiteMock->expects($this->any())->method('getId')->willReturn($websiteId);
     $this->websiteMock->expects($this->any())->method('getName')->willReturn($websiteName);
     $this->groupMock->expects($this->any())->method('getId')->willReturn($groupId);
     $this->groupMock->expects($this->any())->method('getName')->willReturn($groupName);
     $this->storeMock->expects($this->any())->method('getId')->willReturn($storeId);
     $this->storeMock->expects($this->any())->method('getName')->willReturn($storeName);
     $this->assertEquals($this->model->getStoresStructure($isAll, $storeIds, $groupIds, $websiteIds), $expectedResult);
 }
开发者ID:hientruong90,项目名称:magento2_installer,代码行数:14,代码来源:StoreTest.php

示例3: renderVisibilityStructure

 /**
  * Rendering store visibility structure
  *
  * @param array $storeIds
  * @return string
  */
 protected function renderVisibilityStructure(array $storeIds)
 {
     $visibility = '';
     foreach ($this->store->getStoresStructure(false, $storeIds) as $website) {
         $visibility .= $website['label'] . '<br/>';
         foreach ($website['children'] as $group) {
             $visibility .= str_repeat('&nbsp;', 3) . $group['label'] . '<br/>';
             foreach ($group['children'] as $store) {
                 $visibility .= str_repeat('&nbsp;', 6) . $store['label'] . '<br/>';
             }
         }
     }
     return $visibility;
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:20,代码来源:Visibility.php


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