Preheat the oven to 180c and pop in a large, flat baking sheet to heat up.
To make the pastry whizz the flour and butter together in a food processor. Add the egg and whizz again until the pastry comes together and forms a ball. Tip onto a lightly floured work surface and roll out to a thickness of 2-3mm. Line the bottom and sides of the cake tin (using a rolling pin to cut the edge makes it even and flush at the top). Prick the base all over with a fork (this prevents air bubbles forming when baking) then chill in the fridge for 30 minutes (this ensures the pastry doesn’t shrink when cooking.)
Line the chilled pastry case with greaseproof paper, then fill with baking beans (use rice if you don’t have baking beans) and bake for 20 minutes on the hot baking sheet (this will ensure the base of the case heats up quickly and gives crisp pastry.) Remove the baking beans and greaseproof paper and return to the oven for a further 10 minutes or until lightly golden brown.
Reduce the oven temperature to 150c.
To make the filling fry the pancetta cubes in a large non stick frying pan for approx 10 minutes, turning regularly until golden and crisp. Remove with a slotted spoon and set aside (keep the fat behind as this will add loads of flavour to your onions). Add the onion to the pan and gently fry for 5 minutes until softened but not coloured.
Whizz together the eggs and cream together in a blender (this will make the filling super smooth) and season with salt & pepper.
Fill the pastry case with most of the pancetta cubes, onion and grated cheese. Pour over the custard mixture, then scatter over the remaining pancetta, onion and cheese. Return to the oven for 55-60 minutes, then remove and allow to cool to room temperature before removing from the case.