private function getStockId($websiteId)
    {
        if (!isset($this->stockIdByWebsite[$websiteId])) {
            $websiteCode = $this->storeManager->getWebsite($websiteId)->getCode();
            $stock = $this->stockResolver->execute(SalesChannelInterface::TYPE_WEBSITE, $websiteCode);
            $stockId = (int) $stock->getStockId();
            $this->stockIdByWebsite[$websiteId] = $stockId;
        }

        return $this->stockIdByWebsite[$websiteId];
    }
private function getStockId($websiteId)
    {
        if (!isset($this->stockIdByWebsite[$websiteId])) {
            $websiteCode = $this->storeManager->getWebsite($websiteId)->getCode();
            $stock = $this->stockResolver->execute(SalesChannelInterface::TYPE_WEBSITE, $websiteCode);
            $stockId = (int) $stock->getStockId();
            $this->stockIdByWebsite[$websiteId] = $stockId;
        }

        return $this->stockIdByWebsite[$websiteId];
    }
private function getStockId ( $ websiteId ) { if ( ! isset ( $ this -> stockIdByWebsite [ $ websiteId ] ) ) { $ websiteCode = $ this -> storeManager -> getWebsite ( $ websiteId ) -> getCode ( ) ; $ stock = $ this -> stockResolver -> execute ( SalesChannelInterface :: TYPE_WEBSITE , $ websiteCode ) ; $ stockId = ( int ) $ stock -> getStockId ( ) ; $ this -> stockIdByWebsite [ $ websiteId ] = $ stockId ; } return $ this -> stockIdByWebsite [ $ websiteId ] ; }
Retrieve stock_id by website

@param int $websiteId The website Id

@return int
Retrieve stock_id by website