A thief is today serving a prison sentence after staff locked him in their York shop and prevented him from leaving.