After the commencement of a criminal matter by the filing of an information or otherwise, the district attorney shall not enter a nolle prosequi or dispose of the matter or discharge a prisoner from custody by means of a proceeding in lieu of a plea or trial without having obtained the approval of the court.
42 Pa.C.S. § 8932