From 191c2191d587c026445149fc6e916825cde40d30 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 16 Aug 2022 07:32:42 +0000 Subject: [PATCH] Add checking if customer's mobile app flag is already true. #699 --- src/Command/SetCustomerMobileAppFlagCommand.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Command/SetCustomerMobileAppFlagCommand.php b/src/Command/SetCustomerMobileAppFlagCommand.php index 8671865d..6216126c 100644 --- a/src/Command/SetCustomerMobileAppFlagCommand.php +++ b/src/Command/SetCustomerMobileAppFlagCommand.php @@ -53,9 +53,13 @@ class SetCustomerMobileAppFlagCommand extends Command $customer = $this->em->getRepository(Customer::class)->find($cust_id); if ($customer != null) { - error_log('Setting customer mobile app flag to true for ' . $cust_id); - // set mobile app flag - $customer->setHasMobileApp(); + // check if customer mobile app flag is already set to true + if ($customer->hasMobileApp() == false) + { + error_log('Setting customer mobile app flag to true for ' . $cust_id); + // set mobile app flag + $customer->setHasMobileApp(); + } } }