resourceConnection = $resourceConnection; } /** * Given a stock id, return array of sales channels assigned to it * * @param int $stockId * @return array */ public function execute(int $stockId): array { $connection = $this->resourceConnection->getConnection(); $tableName = $this->resourceConnection->getTableName('inventory_stock_sales_channel'); $select = $connection->select() ->from($tableName) ->where('stock_id = ?', $stockId); return $connection->fetchAll($select); } }