| @@ 96-106 (lines=11) @@ | ||
| 93 | * @param string $defaultClass the class to use if none is set in config. |
|
| 94 | * @return object the gateway instance |
|
| 95 | */ |
|
| 96 | public function createGateway($config, $defaultClass = false){
|
|
| 97 | $args = array( |
|
| 98 | $this->getRequestChannel($config), |
|
| 99 | $this->getReplyChannel($config) |
|
| 100 | ); |
|
| 101 | $defaultClass = $defaultClass ? $defaultClass : '\PEIP\Gateway\SimpleMessagingGateway'; |
|
| 102 | $gateway = $this->buildAndModify($config, $args, $defaultClass); |
|
| 103 | $id = (string)$config["id"]; |
|
| 104 | $this->gateways[$id] = $gateway; |
|
| 105 | return $gateway; |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * Creates and registers router from a configuration object. |
|
| @@ 438-448 (lines=11) @@ | ||
| 435 | * @param string $defaultClass the class to use if none is set in config. |
|
| 436 | * @return object the gateway instance |
|
| 437 | */ |
|
| 438 | public function createGateway($config, $defaultClass = false){
|
|
| 439 | $args = array( |
|
| 440 | $this->getRequestChannel($config), |
|
| 441 | $this->getReplyChannel($config) |
|
| 442 | ); |
|
| 443 | $defaultClass = $defaultClass ? $defaultClass : 'SimpleMessagingGateway'; |
|
| 444 | $gateway = ServiceFactory::buildAndModify($config, $args, $defaultClass); |
|
| 445 | $id = (string)$config["id"]; |
|
| 446 | $this->gateways[$id] = $gateway; |
|
| 447 | return $gateway; |
|
| 448 | } |
|
| 449 | ||
| 450 | /** |
|
| 451 | * Creates and registers router from a configuration object. |
|