PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 1.5.5
Fluent Support – Helpdesk & Customer Support Ticket System v1.5.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 1.5.5 All 68 releases
fluent-support / app / Modules / IntegrationSettingsModule.php

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

64 lines 1.5 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 * IntegrationSettingsModule class is responsible for getting/setting Settings related to integration
7 * @package FluentSupport\App\Modules
8 *
9 * @version 1.0.0
10 */
11 class IntegrationSettingsModule
12 {
13 private static $integrations = [];
14
15 /**
16 * getSettings will return settings for a specific integration key
17 * @param $integrationKey
18 * @param false $withFields
19 * @return false
20 */
21 public static function getSettings($integrationKey, $withFields = false)
22 {
23 $integrationClasses = self::$integrations;
24
25 $class = (isset($integrationClasses[$integrationKey])) ? $integrationClasses[$integrationKey] : false;
26
27 if(!$class) {
28 return false;
29 }
30
31
32 return $class->getSettings($withFields);
33 }
34
35 /**
36 * saveSettings save integration settings by integration_key
37 * @param $integrationKey
38 * @param $settings
39 * @return false
40 */
41 public static function saveSettings($integrationKey, $settings)
42 {
43 $integrationClasses = self::$integrations;
44
45 $class = (isset($integrationClasses[$integrationKey])) ? $integrationClasses[$integrationKey] : false;
46
47 if(!$class) {
48 return false;
49 }
50
51 return $class->saveSettings($settings);
52 }
53
54 /**
55 * addIntegration add integration classes into the self property list
56 * @param $class
57 */
58 public static function addIntegration($class)
59 {
60 self::$integrations[$class->getKey()] = $class;
61 }
62
63 }
64