public function setNodeOnPersist(PersistEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticlePageDocument || $event->hasNode()) {
            return;
        }

        $pageTitle = $this->getPageTitle($document);

        // if no page-title exists use a unique-id
        $nodeName = $this->slugifier->slugify($pageTitle ?: uniqid('page-', true));
        $nodeName = $this->resolver->resolveName($event->getParentNode(), $nodeName);
        $node = $event->getParentNode()->addNode($nodeName);

        $event->setNode($node);
    }