Fix bug attemps to retrieve service manager in doctrine tools trait