@@ -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 | ?> |
@@ -17,26 +17,26 @@ |
||
17 | 17 | $this->__queryConstruct(); |
18 | 18 | $this->__fileConstruct(); |
19 | 19 | } |
20 | - public function addModules( $_modules ) { |
|
21 | - if(!is_array($_modules)) |
|
20 | + public function addModules($_modules) { |
|
21 | + if (!is_array($_modules)) |
|
22 | 22 | throw new JException("Parameter must be an array."); |
23 | 23 | foreach ($_modules as $value) |
24 | 24 | $this->addModule($value); |
25 | 25 | } |
26 | - public function addModule( $_module ) { |
|
27 | - if(!is_object($_module)) |
|
26 | + public function addModule($_module) { |
|
27 | + if (!is_object($_module)) |
|
28 | 28 | throw new JException("Parameter must be a object."); |
29 | - if(! is_subclass_of ($_module, "Module")) |
|
29 | + if (!is_subclass_of($_module, "Module")) |
|
30 | 30 | throw new JException("Parameter must be a object inherited from Module object."); |
31 | 31 | $this->modules[$_module->name] = $_module; |
32 | - if($this->currentConnection) |
|
32 | + if ($this->currentConnection) |
|
33 | 33 | $this->modules[$_module->name]->addConnectionMan($this->currentConnection); |
34 | 34 | } |
35 | - public function addConnectionMan( $_connection, $_name = "default") { |
|
35 | + public function addConnectionMan($_connection, $_name = "default") { |
|
36 | 36 | try { |
37 | 37 | $this->__addConnectionMan($_connection, $_name); |
38 | 38 | foreach ($this->modules as &$module) |
39 | - if(isset($this->currentConnection)) |
|
39 | + if (isset($this->currentConnection)) |
|
40 | 40 | $module->addConnectionMan($this->currentConnection, $_name); |
41 | 41 | } catch (Exception $e) { |
42 | 42 | throw new JException($e->getMessage(), 1); |
@@ -18,26 +18,32 @@ |
||
18 | 18 | $this->__fileConstruct(); |
19 | 19 | } |
20 | 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); |
|
21 | + if(!is_array($_modules)) { |
|
22 | + throw new JException("Parameter must be an array."); |
|
23 | + } |
|
24 | + foreach ($_modules as $value) { |
|
25 | + $this->addModule($value); |
|
26 | + } |
|
25 | 27 | } |
26 | 28 | 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."); |
|
29 | + if(!is_object($_module)) { |
|
30 | + throw new JException("Parameter must be a object."); |
|
31 | + } |
|
32 | + if(! is_subclass_of ($_module, "Module")) { |
|
33 | + throw new JException("Parameter must be a object inherited from Module object."); |
|
34 | + } |
|
31 | 35 | $this->modules[$_module->name] = $_module; |
32 | - if($this->currentConnection) |
|
33 | - $this->modules[$_module->name]->addConnectionMan($this->currentConnection); |
|
36 | + if($this->currentConnection) { |
|
37 | + $this->modules[$_module->name]->addConnectionMan($this->currentConnection); |
|
38 | + } |
|
34 | 39 | } |
35 | 40 | public function addConnectionMan( $_connection, $_name = "default") { |
36 | 41 | try { |
37 | 42 | $this->__addConnectionMan($_connection, $_name); |
38 | - foreach ($this->modules as &$module) |
|
39 | - if(isset($this->currentConnection)) |
|
43 | + foreach ($this->modules as &$module) { |
|
44 | + if(isset($this->currentConnection)) |
|
40 | 45 | $module->addConnectionMan($this->currentConnection, $_name); |
46 | + } |
|
41 | 47 | } catch (Exception $e) { |
42 | 48 | throw new JException($e->getMessage(), 1); |
43 | 49 | } |