@@ 116-135 (lines=20) @@ | ||
113 | * @return $this |
|
114 | * @throws \LogicException |
|
115 | */ |
|
116 | public function addTransportType($typeName, $integrationTypeName, TransportInterface $type) |
|
117 | { |
|
118 | if (!isset($this->transportTypes[$integrationTypeName])) { |
|
119 | $this->transportTypes[$integrationTypeName] = new ArrayCollection(); |
|
120 | } |
|
121 | ||
122 | if ($this->transportTypes[$integrationTypeName]->containsKey($typeName)) { |
|
123 | throw new LogicException( |
|
124 | sprintf( |
|
125 | 'Trying to redeclare transport type "%s" for "%s" integration type.', |
|
126 | $typeName, |
|
127 | $integrationTypeName |
|
128 | ) |
|
129 | ); |
|
130 | } |
|
131 | ||
132 | $this->transportTypes[$integrationTypeName]->set($typeName, $type); |
|
133 | ||
134 | return $this; |
|
135 | } |
|
136 | ||
137 | /** |
|
138 | * @param string $integrationTypeName |
|
@@ 236-255 (lines=20) @@ | ||
233 | * @throws \LogicException |
|
234 | * @return $this |
|
235 | */ |
|
236 | public function addConnectorType($typeName, $integrationTypeName, ConnectorInterface $type) |
|
237 | { |
|
238 | if (!isset($this->connectorTypes[$integrationTypeName])) { |
|
239 | $this->connectorTypes[$integrationTypeName] = new ArrayCollection(); |
|
240 | } |
|
241 | ||
242 | if ($this->connectorTypes[$integrationTypeName]->containsKey($typeName)) { |
|
243 | throw new LogicException( |
|
244 | sprintf( |
|
245 | 'Trying to redeclare connector type "%s" for "%s" integration type.', |
|
246 | $typeName, |
|
247 | $integrationTypeName |
|
248 | ) |
|
249 | ); |
|
250 | } |
|
251 | ||
252 | $this->connectorTypes[$integrationTypeName]->set($typeName, $type); |
|
253 | ||
254 | return $this; |
|
255 | } |
|
256 | ||
257 | /** |
|
258 | * @param string $integrationType |