From 85ddbcc0028081eb4276528ed0ee4f58dc291bc8 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 27 Apr 2021 17:47:35 +1200 Subject: [PATCH] [REF] Minor tidy up - use writeRecord This tidy up gets rid of 2 unused variables & an obsolete pass-by-ref and switches to a preferred function call. Note that as a by-product hooks will now be called --- CRM/Core/BAO/ActionSchedule.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index 59081a8fa2..68d3721f1f 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -171,20 +171,16 @@ FROM civicrm_action_schedule cas } /** - * Add the schedules reminders in the db. + * Add the scheduled reminders in the db. * * @param array $params - * (reference ) an assoc array of name/value pairs. - * @param array $ids - * Unused variable. + * An assoc array of name/value pairs. * * @return CRM_Core_DAO_ActionSchedule + * @throws \CRM_Core_Exception */ - public static function add(&$params, $ids = []) { - $actionSchedule = new CRM_Core_DAO_ActionSchedule(); - $actionSchedule->copyValues($params); - - return $actionSchedule->save(); + public static function add(array $params): CRM_Core_DAO_ActionSchedule { + return self::writeRecord($params); } /** @@ -209,10 +205,7 @@ FROM civicrm_action_schedule cas $actionSchedule->copyValues($params); if ($actionSchedule->find(TRUE)) { - $ids['actionSchedule'] = $actionSchedule->id; - CRM_Core_DAO::storeValues($actionSchedule, $values); - return $actionSchedule; } return NULL; -- 2.25.1