/**
* Creates the helper class
*
- * @param $nodeInstance An instance of a NodeHelper class
* @return $helperInstance A prepared instance of this helper
*/
- public static final function createHubSelfConnectHelper (NodeHelper $nodeInstance) {
+ public static final function createHubSelfConnectHelper () {
// Get new instance
$helperInstance = new HubSelfConnectHelper();
- // Set the node instance
- $helperInstance->setNodeInstance($nodeInstance);
-
// Return the prepared instance
return $helperInstance;
}
/**
* Do the self-connect attempt by delivering a package to ourselfs
*
+ * @param $nodeInstance An instance of a NodeHelper class
* @return void
*/
- public function sendPackage () {
+ public function sendPackage (NodeHelper $nodeInstance) {
// Sanity check: Is the node in the approx. state? (active)
- $this->getNodeInstance()->getStateInstance()->validateNodeStateIsActive();
+ $nodeInstance->getStateInstance()->validateNodeStateIsActive();
// Compile the template, this inserts the loaded node data into the gaps.
$this->getTemplateInstance()->compileTemplate();
$packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
// Next, feed the content in. The network package class is a pipe-through class.
- $packageInstance->enqueueRawDataFromTemplate($this);
+ $packageInstance->enqueueRawDataFromTemplate($this, $nodeInstance);
}
/**