@@ -2,45 +2,45 @@ |
||
2 | 2 | jRequire("../Query/Query.php"); |
3 | 3 | jRequire("../File/File.php"); |
4 | 4 | class Module { |
5 | - use Query { |
|
6 | - Query::__construct as private __queryConstruct; |
|
7 | - Query::addConnectionMan as private __addConnectionMan; |
|
8 | - } |
|
9 | - use File { |
|
10 | - File::__construct as private __fileConstruct; |
|
11 | - } |
|
12 | - public $name; |
|
13 | - public $modules; |
|
14 | - public function __construct() { |
|
15 | - $this->name = get_class($this); |
|
16 | - $this->modules = []; |
|
17 | - $this->__queryConstruct(); |
|
18 | - $this->__fileConstruct(); |
|
19 | - } |
|
20 | - public function addModules( $_modules ) { |
|
21 | - if(!is_array($_modules)) |
|
22 | - throw new JException("Parameter must be an array."); |
|
23 | - foreach ($_modules as $value) |
|
24 | - $this->addModule($value); |
|
25 | - } |
|
26 | - public function addModule( $_module ) { |
|
27 | - if(!is_object($_module)) |
|
28 | - throw new JException("Parameter must be a object."); |
|
29 | - if(! is_subclass_of ($_module, "Module")) |
|
30 | - throw new JException("Parameter must be a object inherited from Module object."); |
|
31 | - $this->modules[$_module->name] = $_module; |
|
32 | - if($this->currentConnection) |
|
33 | - $this->modules[$_module->name]->addConnectionMan($this->currentConnection); |
|
34 | - } |
|
35 | - public function addConnectionMan( $_connection, $_name = "default") { |
|
36 | - try { |
|
37 | - $this->__addConnectionMan($_connection, $_name); |
|
38 | - foreach ($this->modules as &$module) |
|
39 | - if(isset($this->currentConnection)) |
|
40 | - $module->addConnectionMan($this->currentConnection, $_name); |
|
41 | - } catch (Exception $e) { |
|
42 | - throw new JException($e->getMessage(), 1); |
|
43 | - } |
|
44 | - } |
|
5 | + use Query { |
|
6 | + Query::__construct as private __queryConstruct; |
|
7 | + Query::addConnectionMan as private __addConnectionMan; |
|
8 | + } |
|
9 | + use File { |
|
10 | + File::__construct as private __fileConstruct; |
|
11 | + } |
|
12 | + public $name; |
|
13 | + public $modules; |
|
14 | + public function __construct() { |
|
15 | + $this->name = get_class($this); |
|
16 | + $this->modules = []; |
|
17 | + $this->__queryConstruct(); |
|
18 | + $this->__fileConstruct(); |
|
19 | + } |
|
20 | + public function addModules( $_modules ) { |
|
21 | + if(!is_array($_modules)) |
|
22 | + throw new JException("Parameter must be an array."); |
|
23 | + foreach ($_modules as $value) |
|
24 | + $this->addModule($value); |
|
25 | + } |
|
26 | + public function addModule( $_module ) { |
|
27 | + if(!is_object($_module)) |
|
28 | + throw new JException("Parameter must be a object."); |
|
29 | + if(! is_subclass_of ($_module, "Module")) |
|
30 | + throw new JException("Parameter must be a object inherited from Module object."); |
|
31 | + $this->modules[$_module->name] = $_module; |
|
32 | + if($this->currentConnection) |
|
33 | + $this->modules[$_module->name]->addConnectionMan($this->currentConnection); |
|
34 | + } |
|
35 | + public function addConnectionMan( $_connection, $_name = "default") { |
|
36 | + try { |
|
37 | + $this->__addConnectionMan($_connection, $_name); |
|
38 | + foreach ($this->modules as &$module) |
|
39 | + if(isset($this->currentConnection)) |
|
40 | + $module->addConnectionMan($this->currentConnection, $_name); |
|
41 | + } catch (Exception $e) { |
|
42 | + throw new JException($e->getMessage(), 1); |
|
43 | + } |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | ?> |