@@ -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 | } |