From bf86a460827c3e94d291eff512ba2431bb4f0a73 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 21 Nov 2019 08:03:33 +0000 Subject: [PATCH] Fix for errors found during testing. #277 --- src/Controller/APIController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;