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/ScenarioProcessClass.php +6 -7 10.1.4 → 11.1.0 View file →
@@ -14,16 +14,16 @@
14 14 $this->table = 'scenario_process';
15 15 $this->pkey = 'id';
16 16 }
17 17
18 - public function getOneByScenarioIdUserId(int $scenarioId, int $userId)
18 + public function hasUserProcess(int $scenarioId, int $userId): bool
19 19 {
20 - $query = 'SELECT * FROM #__acym_scenario_process WHERE scenario_id = '.$scenarioId.' AND user_id = '.$userId;
20 + $process = acym_loadObject('SELECT * FROM #__acym_scenario_process WHERE scenario_id = '.$scenarioId.' AND user_id = '.$userId);
21 21
22 - return acym_loadResult($query);
22 + return !empty($process);
23 23 }
24 24
25 - public function endProcess(int $scenarioProcessId)
25 + public function endProcess(int $scenarioProcessId): void
26 26 {
27 27 $scenarioProcess = new \stdClass();
28 28 $scenarioProcess->id = $scenarioProcessId;
29 29 $scenarioProcess->end_at = acym_date('now', 'Y-m-d H:i:s', false);
@@ -30,9 +30,9 @@
30 30
31 31 $this->save($scenarioProcess);
32 32 }
33 33
34 - public function getNumberOfTriggerByScenarioId(int $scenarioId)
34 + public function getNumberOfTriggerByScenarioId(int $scenarioId): int
35 35 {
36 36 $numberOfTrigger = acym_loadResult('SELECT COUNT(*) FROM #__acym_scenario_process WHERE scenario_id = '.$scenarioId);
37 37
38 38 if (empty($numberOfTrigger)) {
@@ -38,11 +38,10 @@
38 38 if (empty($numberOfTrigger)) {
39 39 return 0;
40 40 }
41 41
42 - return $numberOfTrigger;
42 + return (int)$numberOfTrigger;
43 43 }
44 -
45 44
46 45 public function getMatchingElements(array $settings = []): array
47 46 {
48 47 $results = [];