/**
  * Prepare array of store groups
  * can be filtered to contain default store group or not by $withDefault flag
  * depending on flag $codeKey array keys can be group id or group code
  *
  * @param bool $withDefault
  * @param bool $codeKey
  * @return \Magento\Store\Model\Group[]
  */
 public function getGroups($withDefault = false, $codeKey = false)
 {
     $groups = [];
     if ($withDefault) {
         $key = $codeKey ? $this->_group->getCode() : $this->_group->getId();
         $groups[$key] = $this->_group;
     }
     return $groups;
 }
 /**
  * Update default store (store view) for Baltic group (as EN store) and create new stores for Balrics (as RU store)
  * and for Russian group (as RU store).
  */
 private function processStores()
 {
     /* load default store and update it as Baltic_EN*/
     $this->storeBalticEn = $this->saveStore(self::DEF_STORE_ID_DEFAULT, true, 'EN');
     /* create RU-store for Baltic group */
     $this->storeBalticRu = $this->saveStore(self::DEF_STORE_ID_BALTIC_RU, true, 'RU', 'baltic_ru', self::DEF_WEBSITE_ID_MAIN, $this->groupBaltic->getId(), 10);
     /* create Ru-store for Russian group */
     $this->storeRussianRu = $this->saveStore(self::DEF_STORE_ID_RUSSIAN_RU, true, 'RU', 'russian_ru', self::DEF_WEBSITE_ID_MAIN, $this->groupRussian->getId(), 10);
 }
Beispiel #3
0
 /**
  * Set group model for store
  *
  * @param Group $group
  * @return Store
  */
 public function setGroup(Group $group)
 {
     $this->setGroupId($group->getId());
     return $this;
 }
Beispiel #4
0
 /**
  * Set group model for store
  *
  * @param \Magento\Store\Model\Group $group
  * @return void
  */
 public function setGroup(\Magento\Store\Model\Group $group)
 {
     $this->setGroupId($group->getId());
 }
Beispiel #5
0
 /**
  * @param \Magento\Store\Model\Group $group
  * @return bool
  */
 public function isStoreGroupSelected(\Magento\Store\Model\Group $group)
 {
     return $this->getStoreGroupId() === $group->getId() && $this->getStoreGroupId() === null;
 }
Beispiel #6
0
 /**
  * Loads default store and returns its id
  *
  * @return int
  */
 public function getGroupId()
 {
     $this->loadStore();
     return $this->group->getId();
 }