Set/Get current store view

        :param store_view: Store view ID or Code
        :return: int
766182
def currentStore(self, store_view=None):
        
        args = [store_view] if store_view else []
        return int(self.call('catalog_category_attribute.currentStore', args))
1093526
def GetView(self, viewname):
        

        # Build Request
        soap_request = soap('GetView')
        soap_request.add_parameter('listName', self.listName)

        if viewname == None:
            views = self.GetViewCollection()
            for view in views:
                if 'DefaultView' in view:
                    if views[view]['DefaultView'] == 'TRUE':
                        viewname = view
                        break

        if self.listName not in ['UserInfo', 'User Information List']:
            soap_request.add_parameter('viewName', self.views[viewname]['Name'][1:-1])
        else:
            soap_request.add_parameter('viewName', viewname)
        self.last_request = str(soap_request)

        # Send Request
        response = self._session.post(url=self._url('Views'),
                                      headers=self._headers('GetView'),
                                      data=str(soap_request),
                                      verify=self._verify_ssl,
                                      timeout=self.timeout)

        # Parse Response
        if response.status_code == 200:
            envelope = etree.fromstring(response.text.encode('utf-8'), parser=etree.XMLParser(huge_tree=self.huge_tree))
            view = envelope[0][0][0][0]
            info = {key: value for (key, value) in view.items()}
            fields = [x.items()[0][1] for x in view[1]]
            return {'info': info, 'fields': fields}

        else:
            raise Exception("ERROR:", response.status_code, response.text)
377334
public function setItemOrderStoreName(&$item, $store_model)
    {
        if (isset($item['store_id'])) {
            $data = $store_model->get($item['store_id']);
            $item['store_name'] = empty($data['name']) ? 'Unknown' : $data['name'];
        }
    }
78635
def view_get(method_name):
    

    def view_get(_value, context, **_params):
        method = getattr(context["view"], method_name)
        return _get(method, context["key"], (), {})

    return view_get
271892
static BitStore newRangedView(BitStore store, int from, int to) {
		if (store == null) throw new IllegalArgumentException("null store");
		if (from < 0) throw new IllegalArgumentException();
		if (from > to) throw new IllegalArgumentException();
		if (to > store.size()) throw new IllegalArgumentException();
		return new AbstractBitStore() {

			@Override
			public int size() {
				return to - from;
			}

			@Override
			public boolean getBit(int index) {
				return store.getBit(adjIndex(index));
			}

			@Override
			public void setBit(int index, boolean value) {
				store.setBit(adjIndex(index), value);
			}

			@Override
			public void flipBit(int index) {
				store.flipBit(adjIndex(index));
			}

			@Override
			public long getBits(int position, int length) {
				return store.getBits(adjPosition(position), length);
			}

			@Override
			public int getBitsAsInt(int position, int length) {
				return store.getBitsAsInt(adjPosition(position), length);
			}

			@Override
			public boolean getThenSetBit(int index, boolean value) {
				return store.getThenSetBit(adjIndex(index), value);
			}

			@Override
			public void setStore(int position, BitStore that) {
				store.setStore(adjPosition(position), that);
			}

			@Override
			public BitWriter openWriter() {
				return Bits.newBitWriter(store, from, to);
			}

			@Override
			public BitWriter openWriter(int finalPos, int initialPos) {
				return store.openWriter(adjPosition(finalPos), adjPosition(initialPos));
			}

			@Override
			public BitReader openReader() {
				return store.openReader(from, to);
			}

			@Override
			public BitReader openReader(int finalPos, int initialPos) {
				return store.openReader(adjPosition(finalPos), adjPosition(initialPos));
			}

			@Override
			public boolean isMutable() {
				return store.isMutable();
			}

			private int adjIndex(int index) {
				if (index < 0) throw new IllegalArgumentException("negative index");
				index += from;
				if (index >= to) throw new IllegalArgumentException("index too large");
				return index;
			}

			private int adjPosition(int position) {
				if (position < 0) throw new IllegalArgumentException("negative position");
				position += from;
				if (position > to) throw new IllegalArgumentException("position too large");
				return position;
			}
		};
	}
21731
def get_value_for_datastore(self, model_instance, cached=False):
        """"""
        value = getattr(model_instance, self._attr_name(), None)
        if not cached:
            value = getattr(model_instance, self.property_name).keys()
            setattr(model_instance, self._attr_name(), value)
        return value
1089187
def perform(self, store, count):
        
        self.count = count

        try:
            self.upgradeStore(store)
            print 'Upgrade complete'
        except errors.ItemUpgradeError as e:
            print 'Upgrader error:'
            e.originalFailure.printTraceback(file=sys.stdout)
            print self.errorMessageFormat % (
                e.oldType.typeName, e.storeID, e.oldType.schemaVersion,
                e.newType.schemaVersion)
1181009
public function getOtherStoresSettings(): int
    {
	    return (int)$this->_scopeConfig->getValue(self::OTHER_STORES_CONFIG_PATH, ScopeInterface::SCOPE_STORE);
    }
227594
def get(self, key):
    ''''''
    value = None
    for store in self._stores:
      value = store.get(key)
      if value is not None:
        break

    # add model to lower stores only
    if value is not None:
      for store2 in self._stores:
        if store == store2:
          break
        store2.put(key, value)

    return value
1132567
public function editStore($store_id = null)
    {
        $this->setStore($store_id);
        $this->seTitleEditStore();
        $this->setBreadcrumbEditStore();

        $this->setData('store', $this->data_store);
        $this->setData('themes', $this->getListThemeStore());
        $this->setData('is_default', $this->isDefaultStore());
        $this->setData('can_delete', $this->canDeleteStore());
        $this->setData('countries', $this->getCountriesStore());
        $this->setData('collections', $this->getListCollectionStore());
        $this->setData('languages', $this->language->getList(array('enabled' => true)));

        $this->submitEditStore();
        $this->setDataEditStore();

        $this->setJsEditStore();
        $this->outputEditStore();
    }
214675
def _set_current_page(self, current_page):
        
        if not current_page:
            self.resolve_current_page()

        if not self._is_valid_page_number(current_page):
            return 1

        return current_page
546668
public function getLangcodeFromStoreId($store_id) {
    $mapping = $this->getStoreLanguageMapping();
    $mapping = is_array($mapping) && !empty($mapping) ? array_flip(array_filter($mapping)) : NULL;

    if (empty($store_id)) {
      return array_shift($mapping);
    }

    return !empty($mapping[$store_id]) ? $mapping[$store_id] : NULL;
  }
1248966
def raw
      @raw_store ||=
        begin
          store = with(raw: true, only: [:load, :store, :create, :delete])
          store.instance_variable_set(:@raw_store, store)
          store
        end
    end
1247874
def update_view(self, view_id, attributes):
        
        if not isinstance(attributes, dict):
            raise TypeError('Must be of type dict')
        attribute_data = json.dumps(attributes)
        return self.transport.PUT(url='/view/{}'.format(view_id),
                                  body=attribute_data, type='application/json')
615029
def store(self, name=None):
        
        if name is None:
            name = self.get_default_driver()

        self._stores[name] = self._get(name)

        return self._stores[name]
722915
function getResource(storeName, item) {
		var res,
			view = this,
			store = $views[storeName];

		res = store && store[item];
		while ((res === undefined) && view) {
			store = view.tmpl[storeName];
			res = store && store[item];
			view = view.parent;
		}
		return res;
	}
1046605
private function getCurrentStoreId()
    {
        $storeId = $this->storeManager->getStore()->getId();

        if ($storeId == 0) {
            $storeId = $this->storeManager->getDefaultStoreView()->getId();
        }

        return $storeId;
    }