public function merge(ProvisionNode $provisionNode) { // inject the datasource node if available if ($datasource = $provisionNode->getDatasource()) { $this->injectDatasource($datasource); } // load the steps of this instance $localSteps = $this->getInstallation()->getSteps(); // merge it with the ones found in the passed provisioning node foreach ($provisionNode->getInstallation()->getSteps() as $stepToMerge) { foreach ($localSteps as $key => $step) { if ($step->getType() === $stepToMerge->getType()) { $localSteps[$key] = $stepToMerge; } else { $localSteps[$stepToMerge->getUuid()] = $stepToMerge; } } } // set the installation steps $this->getInstallation()->setSteps($localSteps); }