public function beforeProcess() { $stockItem = $this->getEventObserver()->getData('object'); if (!$stockItem instanceof \Magento\CatalogInventory\Model\Stock\Item) { throw new \Ess\M2ePro\Model\Exception('StockItem event doesn\'t have correct StockItem instance.'); } $this->stockItem = $stockItem; $this->stockItemId = (int) $this->stockItem->getId(); $this->storeId = (int) $this->stockItem->getData('store_id'); }