1: <?php
2: /**
3: * This code is licensed under AGPLv3 license or Afterlogic Software License
4: * if commercial version of the product was purchased.
5: * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files.
6: */
7:
8: namespace Aurora\System\Module;
9:
10: /**
11: * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0
12: * @license https://afterlogic.com/products/common-licensing Afterlogic Software License
13: * @copyright Copyright (c) 2019, Afterlogic Corp.
14: *
15: * @package Api
16: */
17: class TenantSettings extends \Aurora\System\AbstractSettings
18: {
19: protected $sTenantName;
20:
21: public function __construct($sModuleName, $sTenantName)
22: {
23: $this->sTenantName = $sTenantName;
24: $sTenantsPath = $sPath = \Aurora\System\Api::GetModuleManager()->GetModulesSettingsPath() . 'tenants';
25:
26: if (!file_exists($sTenantsPath)) {
27: @\mkdir($sTenantsPath);
28: }
29:
30: $sPath = $sTenantsPath . '/' . $sTenantName . '/' . $sModuleName . '.config.json';
31: parent::__construct($sPath);
32: }
33:
34: /**
35: * @var \Aurora\System\SettingsProperty
36: */
37: public function SetProperty($oProperty)
38: {
39: $this->aContainer[$oProperty->Name] = $oProperty;
40: }
41:
42: /**
43: * @return string
44: */
45: public function GetTenantName()
46: {
47: return $this->sTenantName;
48: }
49: }
50: