A man was dramatically taken down to the cells to start a prison sentence after magistrates decided that his latest breach of a restraining order left his ex partner vulnerable.