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 Decorator
18: {
19: /**
20: *
21: * @var string
22: */
23: protected $sModuleName;
24:
25: /**
26: *
27: * @param string $sModuleName
28: */
29: public function __construct($sModuleName)
30: {
31: $this->sModuleName = $sModuleName;
32: }
33:
34: /**
35: *
36: * @param string $sMethodName
37: * @param array $aArguments
38: * @return mixed
39: */
40: public function __call($sMethodName, $aArguments)
41: {
42: $mResult = false;
43: $oModule = \Aurora\System\Api::GetModule($this->sModuleName);
44: if ($oModule instanceof AbstractModule) {
45: $mResult = $oModule->CallMethod($sMethodName, $aArguments);
46: }
47:
48: return $mResult;
49: }
50:
51: public function GetSettings()
52: {
53: $mResult = null;
54:
55: $oModule = \Aurora\System\Api::GetModule($this->sModuleName);
56: if ($oModule instanceof AbstractModule) {
57: $mResult = $oModule->GetSettings();
58: }
59:
60: return $mResult;
61: }
62:
63: public function GetErrors()
64: {
65: $mResult = null;
66:
67: $oModule = \Aurora\System\Api::GetModule($this->sModuleName);
68: if ($oModule instanceof AbstractModule) {
69: $mResult = $oModule->GetErrors();
70: }
71:
72: return $mResult;
73: }
74:
75: public function GetAdditionalEntityFieldsToEdit()
76: {
77: $mResult = null;
78:
79: $oModule = \Aurora\System\Api::GetModule($this->sModuleName);
80: if ($oModule instanceof AbstractModule) {
81: $mResult = $oModule->GetAdditionalEntityFieldsToEdit();
82: }
83:
84: return $mResult;
85: }
86: }
87:
88: function Decorator()
89: {
90: echo 'Decorator';
91: }
92: