1In addition to the provisions of Article 228 of the Code of Criminal Procedure, the measure of arrest in prison may be imposed against a child as a last alternative and only upon fulfilment of one of the following criteria:
athe sanction foreseen for the criminal offence of which the child is accused is imprisonment and the minimum sentence is over 7 years;
b"the measure is indispensable, because the child: i) is a threat to himself/herself and/or to others and such threat may not be avoided by any other way; ii) tries to flee justice."