diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index 8ee33c0a..197021c5 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -2191,7 +2191,8 @@ class APIController extends Controller protected function findCustomerByNumber($number) { - $customers = $this->em->getRepository(Customer::class)->findBy(['phone_mobile' => $number]); + $em = $this->getDoctrine()->getManager(); + $customers = $em->getRepository(Customer::class)->findBy(['phone_mobile' => $number]); // find the customer with the most number of cars $car_count = 0;