Melt the butter in a large heavy saucepan and add the chopped onion and garlic. Cook gently for about 5 minutes until soft but not coloured. Pour in the wine and boil hard to reduce until the liquid has nearly evaporated.
Stir in the rice to coat. Add a ladleful of stock and simmer, stirring, until it has been mostly absorbed. Continue cooking and adding the stock, a ladleful at a time, until all the stock has been absorbed, about 20 minutes.
The rice should be tender and creamy but still have some bite to it. Taste and season with salt and pepper and stir in the parmesan. Remove from the heat and cool completely.
Lightly whisk the egg and mix into the cold risotto. Take a couple of tablespoons of risotto and, with wet hands, spread it in the palm of one hand. Lay a basil leaf and cube of mozzarella on top of the risotto. Take another couple of tablespoons of risotto and place it over the mozzarella and basil to enclose them completely. Shape into a round cake, about 2.5cm/1in thick. Form the remaining risotto into an additional 3 cakes.
In a food processor, chop the dried bread into fine crumbs or use store-bought crumbs. Pour the bread crumbs into a shallow bowl and roll the risotto cakes in the bread crumbs until they are evenly covered. Heat the oil in a large heavy saucepan to about 180C/350F, or until a bread crumb dropped into the oil sizzles immediately. Fry the risotto cakes a few at a time about 2 minutes per side, until golden. Drain on kitchen paper, sprinkle with salt.