Model/Validator/ScopeValidator.php
private function isValidStoreId($storeId)
    {
        $stores = $this->storeManager->getStores(true);
        if (array_key_exists($storeId, $stores)) {
            return true;
        }

        // @todo hs: build up array of storeCodes, to prevent wasting time looping
        if (is_numeric($storeId)) {
            // Dont bother checking store codes on numeric input
            return false;
        }
        /** @var Store $store */
        foreach ($stores as $store) {
            if ($store->getCode() == $storeId) {
                return true;
            }
        }

        return false;
    }
private function isValidStoreId($storeId)
    {
        $stores = $this->storeManager->getStores(true);
        if (array_key_exists($storeId, $stores)) {
            return true;
        }

        // @todo hs: build up array of storeCodes, to prevent wasting time looping
        if (is_numeric($storeId)) {
            // Dont bother checking store codes on numeric input
            return false;
        }
        /** @var Store $store */
        foreach ($stores as $store) {
            if ($store->getCode() == $storeId) {
                return true;
            }
        }

        return false;
    }
private function isValidStoreId ( $ storeId ) { $ stores = $ this -> storeManager -> getStores ( true ) ; if ( array_key_exists ( $ storeId , $ stores ) ) { return true ; } // @todo hs: build up array of storeCodes, to prevent wasting time looping if ( is_numeric ( $ storeId ) ) { // Dont bother checking store codes on numeric input return false ; } /** @var Store $store */ foreach ( $ stores as $ store ) { if ( $ store -> getCode ( ) == $ storeId ) { return true ; } } return false ; }
Check if the given store id is a valid store id

@param int $storeId Store ID
@return bool
Check if the given store id is a valid store id