PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/Classes/ScenarioHistoryLineClass.php +10 -10 10.2.2 → 11.1.0 View file →
@@ -14,9 +14,9 @@
14 14 $this->table = 'scenario_history_line';
15 15 $this->pkey = 'id';
16 16 }
17 17
18 - public function save($element)
18 + public function save(object $element): ?int
19 19 {
20 20 if (isset($element->params) && is_array($element->params)) {
21 21 $element->params = json_encode($element->params);
22 22 }
@@ -23,17 +23,8 @@
23 23
24 24 return parent::save($element);
25 25 }
26 26
27 - private function formatHistoryLine($historyLine)
28 - {
29 - if (!empty($historyLine->params)) {
30 - $historyLine->params = json_decode($historyLine->params);
31 - }
32 -
33 - return $historyLine;
34 - }
35 -
36 27 public function getAllByProcessId(int $processId): array
37 28 {
38 29 return array_map([$this, 'formatHistoryLine'], acym_loadObjectList('SELECT * FROM #__acym_scenario_history_line WHERE scenario_process_id = '.$processId, 'id'));
39 30 }
@@ -84,6 +75,15 @@
84 75 $results['elements'] = acym_loadObjectList($query, 'id', $settings['offset'], $settings['elementsPerPage']);
85 76 $results['total'] = acym_loadObject($queryCount);
86 77
87 78 return $results;
79 + }
80 +
81 + private function formatHistoryLine(object $historyLine): object
82 + {
83 + if (!empty($historyLine->params)) {
84 + $historyLine->params = json_decode($historyLine->params);
85 + }
86 +
87 + return $historyLine;
88 88 }
89 89 }