PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 All 69 releases
fluent-support / app / Modules / IntegrationSettingsModule.php

IntegrationSettingsModule.php in Fluent Support – Helpdesk & Customer Support Ticket System 2.4.5, at app/Modules/IntegrationSettingsModule.php

57 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentSupport\App\Modules;
4
5 /**
6 * Registry of notification integrations and their settings.
7 */
8 class IntegrationSettingsModule
9 {
10 private static $integrations = [];
11
12 /**
13 * @param string $integrationKey
14 * @param bool $withFields
15 * @return mixed|false False when the integration isn't registered.
16 */
17 public static function getSettings($integrationKey, $withFields = false)
18 {
19 $integrationClasses = self::$integrations;
20
21 $class = (isset($integrationClasses[$integrationKey])) ? $integrationClasses[$integrationKey] : false;
22
23 if(!$class) {
24 return false;
25 }
26
27 return $class->getSettings($withFields);
28 }
29
30 /**
31 * @param string $integrationKey
32 * @param array $settings
33 * @return mixed|false False when the integration isn't registered.
34 */
35 public static function saveSettings($integrationKey, $settings)
36 {
37 $integrationClasses = self::$integrations;
38
39 $class = (isset($integrationClasses[$integrationKey])) ? $integrationClasses[$integrationKey] : false;
40
41 if(!$class) {
42 return false;
43 }
44
45 return $class->saveSettings($settings);
46 }
47
48 /**
49 * @param \FluentSupport\App\Services\Integrations\NotificationIntegrationBase $class
50 */
51 public static function addIntegration($class)
52 {
53 self::$integrations[$class->getKey()] = $class;
54 }
55
56 }
57