Neos\Neos\Service\View\NodeView::assignNodes PHP Метод

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

public assignNodes ( array $nodes )
$nodes array
    public function assignNodes(array $nodes)
    {
        $data = array();
        foreach ($nodes as $node) {
            if ($node->getPath() !== '/') {
                $q = new FlowQuery(array($node));
                $closestDocumentNode = $q->closest('[instanceof Neos.Neos:Document]')->get(0);
                if ($closestDocumentNode !== null) {
                    $data[] = array('nodeContextPath' => $node->getContextPath(), 'documentNodeContextPath' => $closestDocumentNode->getContextPath());
                } else {
                    $this->systemLogger->log('You have a node that is no longer connected to a parent. Path: ' . $node->getPath() . ' (Identifier: ' . $node->getIdentifier() . ')');
                }
            }
        }
        $this->assign('value', array('data' => $data, 'success' => true));
    }

Usage Example

Пример #1
0
 /**
  * Get every unpublished node in the workspace with the given workspace name
  *
  * @param Workspace $workspace
  * @return void
  */
 public function getWorkspaceWideUnpublishedNodesAction($workspace)
 {
     $this->view->assignNodes($this->publishingService->getUnpublishedNodes($workspace));
 }