PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / trunk
Fluent Support – Helpdesk & Customer Support Ticket System vtrunk
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 trunk, at app/Modules/IntegrationSettingsModule.php

63 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 return $class->getSettings($withFields);
32 }
33
34 /**
35 * saveSettings save integration settings by integration_key
36 * @param $integrationKey
37 * @param $settings
38 * @return false || object
39 */
40 public static function saveSettings($integrationKey, $settings)
41 {
42 $integrationClasses = self::$integrations;
43
44 $class = (isset($integrationClasses[$integrationKey])) ? $integrationClasses[$integrationKey] : false;
45
46 if(!$class) {
47 return false;
48 }
49
50 return $class->saveSettings($settings);
51 }
52
53 /**
54 * addIntegration add integration classes into the self property list
55 * @param $class
56 */
57 public static function addIntegration($class)
58 {
59 self::$integrations[$class->getKey()] = $class;
60 }
61
62 }
63