For the purpose of all enactments and instruments made under enactments relating to disqualification for loss of office of persons sentenced to imprisonment an order for detention in a young offenders centre shall be deemed to be a sentence of imprisonment.