| @@ -1,12 +1,24 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace FluentSupport\App\Modules; |
| 4 | 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 | + */ | |
| 5 | 11 | class IntegrationSettingsModule |
| 6 | 12 | { |
| 7 | 13 | private static $integrations = []; |
| 8 | 14 | |
| 15 | + /** | |
| 16 | + * getSettings will return settings for a specific integration key | |
| 17 | + * @param $integrationKey | |
| 18 | + * @param false $withFields | |
| 19 | + * @return false | |
| 20 | + */ | |
| 9 | 21 | public static function getSettings($integrationKey, $withFields = false) |
| 10 | 22 | { |
| 11 | 23 | $integrationClasses = self::$integrations; |
| 12 | 24 | |
| @@ -15,12 +27,17 @@ | ||
| 15 | 27 | if(!$class) { |
| 16 | 28 | return false; |
| 17 | 29 | } |
| 18 | 30 | |
| 19 | - | |
| 20 | 31 | return $class->getSettings($withFields); |
| 21 | 32 | } |
| 22 | 33 | |
| 34 | + /** | |
| 35 | + * saveSettings save integration settings by integration_key | |
| 36 | + * @param $integrationKey | |
| 37 | + * @param $settings | |
| 38 | + * @return false || object | |
| 39 | + */ | |
| 23 | 40 | public static function saveSettings($integrationKey, $settings) |
| 24 | 41 | { |
| 25 | 42 | $integrationClasses = self::$integrations; |
| 26 | 43 | |
| @@ -32,8 +49,12 @@ | ||
| 32 | 49 | |
| 33 | 50 | return $class->saveSettings($settings); |
| 34 | 51 | } |
| 35 | 52 | |
| 53 | + /** | |
| 54 | + * addIntegration add integration classes into the self property list | |
| 55 | + * @param $class | |
| 56 | + */ | |
| 36 | 57 | public static function addIntegration($class) |
| 37 | 58 | { |
| 38 | 59 | self::$integrations[$class->getKey()] = $class; |
| 39 | 60 | } |