Neos\Neos\Service\Controller\NodeController::createAction PHP Метод

createAction() публичный Метод

We need to call persistAll() in order to return the nextUri. We can't persist only the nodes in NodeDataRepository because they might be connected to images / resources which need to be updated at the same time.
public createAction ( Node $referenceNode, array $nodeData, string $position ) : void
$referenceNode Neos\ContentRepository\Domain\Model\Node
$nodeData array
$position string where the node should be added (allowed: before, into, after)
Результат void
    public function createAction(Node $referenceNode, array $nodeData, $position)
    {
        $newNode = $this->nodeOperations->create($referenceNode, $nodeData, $position);
        if ($this->request->getHttpRequest()->isMethodSafe() === false) {
            $this->persistenceManager->persistAll();
        }
        $nextUri = $this->uriBuilder->reset()->setFormat('html')->setCreateAbsoluteUri(true)->uriFor('show', array('node' => $newNode), 'Frontend\\Node', 'Neos.Neos');
        $this->view->assign('value', array('data' => array('nextUri' => $nextUri), 'success' => true));
    }