resource = $resource; } /** * @inheritdoc */ public function execute(string $sku, int $stockId): bool { $connection = $this->resource->getConnection(); $select = $connection->select() ->from( ['stock_source_link' => $this->resource->getTableName(StockSourceLink::TABLE_NAME_STOCK_SOURCE_LINK)] )->join( ['inventory_source_item' => $this->resource->getTableName(SourceItem::TABLE_NAME_SOURCE_ITEM)], 'inventory_source_item.' . SourceItemInterface::SOURCE_CODE . ' = stock_source_link.' . SourceItemInterface::SOURCE_CODE, [] )->where( 'stock_source_link.' . StockSourceLinkInterface::STOCK_ID . ' = ?', $stockId )->where( 'inventory_source_item.' . SourceItemInterface::SKU . ' = ?', $sku ); return (bool)$connection->fetchOne($select); } }