The court shall impose a sentence of total confinement if, having regard to the nature and circumstances of the crime and the history, character, and condition of the defendant, it is of the opinion that the total confinement of the defendant is necessary because:
(1) there is undue risk that during a period of probation or partial confinement the defendant will commit another crime;(2) the defendant is in need of correctional treatment that can be provided most effectively by his commitment to an institution; or(3) a lesser sentence will depreciate the seriousness of the crime of the defendant.1974, Dec. 30, P.L. 1052, No. 345, § 1, effective in 90 days. Renumbered from 18 Pa.C.S. § 1325 by 1980, Oct. 5, P.L. 693, No. 142, § 401(a), effective in 60 days.