use civi statics
authordemeritcowboy <demeritcowboy@hotmail.com>
Sun, 22 Jan 2023 00:02:53 +0000 (19:02 -0500)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Sun, 22 Jan 2023 00:05:43 +0000 (19:05 -0500)
CRM/Case/XMLProcessor/Report.php

index 745a299dd72b9845ff36bfc60502c99b02267d4c..a6fb91e282fbec4b9cb4e368a4e1561544dc6234 100644 (file)
@@ -199,7 +199,6 @@ AND    ac.case_id = %1
    * @return mixed
    */
   public function &getActivityInfo($clientID, $activityID, $anyActivity = FALSE, $redact = 0) {
-    static $activityInfos = [];
     if ($redact) {
       $this->_isRedact = 1;
       $this->getRedactionRules();
@@ -211,8 +210,8 @@ AND    ac.case_id = %1
       $index = $index . '_' . $clientID;
     }
 
-    if (!array_key_exists($index, $activityInfos)) {
-      $activityInfos[$index] = [];
+    if (!array_key_exists($index, \Civi::$statics[__CLASS__][__FUNCTION__]['activityInfos'] ?? [])) {
+      \Civi::$statics[__CLASS__][__FUNCTION__]['activityInfos'][$index] = [];
       $selectCaseActivity = "";
       $joinCaseActivity = "";
 
@@ -249,12 +248,12 @@ WHERE      a.id = %1
           $activityTypeInfo = $activityTypes[$dao->activity_type_id];
         }
         if ($activityTypeInfo) {
-          $activityInfos[$index] = $this->getActivity($clientID, $dao, $activityTypeInfo);
+          \Civi::$statics[__CLASS__][__FUNCTION__]['activityInfos'][$index] = $this->getActivity($clientID, $dao, $activityTypeInfo);
         }
       }
     }
 
-    return $activityInfos[$index];
+    return \Civi::$statics[__CLASS__][__FUNCTION__]['activityInfos'][$index];
   }
 
   /**