protected function applyNodeCreationHandlers(NodeInterface $node)
{
$data = $this->getData() ?: [];
$nodeType = $node->getNodeType();
if (isset($nodeType->getOptions()['nodeCreationHandlers'])) {
$nodeCreationHandlers = $nodeType->getOptions()['nodeCreationHandlers'];
if (is_array($nodeCreationHandlers)) {
foreach ($nodeCreationHandlers as $nodeCreationHandlerConfiguration) {
$nodeCreationHandler = new $nodeCreationHandlerConfiguration['nodeCreationHandler']();
if (!$nodeCreationHandler instanceof NodeCreationHandlerInterface) {
throw new InvalidNodeCreationHandlerException(sprintf('Expected NodeCreationHandlerInterface but got "%s"', get_class($nodeCreationHandler)), 1364759956);
}
$nodeCreationHandler->handle($node, $data);
}
}
}
}