From 954b0b8add20563f884ab159e64577d38bd2d07a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 7 Apr 2023 14:06:03 +1200 Subject: [PATCH] Clarify return on BAO_Activity::create --- CRM/Activity/BAO/Activity.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 69442988d896..13d59afe0022 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -255,11 +255,10 @@ public static function deleteActivityContact($activityId, $recordTypeID = NULL) * @param array $params * Associated array of the submitted values. * + * @return CRM_Activity_DAO_Activity * @throws CRM_Core_Exception - * - * @return CRM_Activity_BAO_Activity|null|object */ - public static function create(&$params) { + public static function create(array &$params) { // CRM-20958 - These fields are managed by MySQL triggers. Watch out for clients resaving stale timestamps. unset($params['created_date']); unset($params['modified_date']); @@ -317,14 +316,8 @@ public static function create(&$params) { // start transaction $transaction = new CRM_Core_Transaction(); - $result = $activity->save(); - if (is_a($result, 'CRM_Core_Error')) { - $transaction->rollback(); - return $result; - } - $activityId = $activity->id; $activityRecordTypes = [ 'source_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source'),