Neos\ContentRepository\Domain\Model\NodeInterface::getChildNodes PHP Method

getChildNodes() public method

If a node type is specified, only nodes of that type are returned.
public getChildNodes ( string $nodeTypeFilter = null, integer $limit = null, integer $offset = null ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface>
$nodeTypeFilter string If specified, only nodes with that node type are considered
$limit integer An optional limit for the number of nodes to find. Added or removed nodes can still change the number nodes!
$offset integer An optional offset for the query
return array<\Neos\ContentRepository\Domain\Model\NodeInterface>
    public function getChildNodes($nodeTypeFilter = null, $limit = null, $offset = null);

Usage Example

 /**
  * Publishes the given node to the specified target workspace. If no workspace is specified, the base workspace
  * is assumed.
  *
  * If the given node is a Document or has ContentCollection child nodes, these nodes are published as well.
  *
  * @param NodeInterface $node
  * @param Workspace $targetWorkspace If not set the base workspace is assumed to be the publishing target
  * @return void
  * @api
  */
 public function publishNode(NodeInterface $node, Workspace $targetWorkspace = null)
 {
     if ($targetWorkspace === null) {
         $targetWorkspace = $node->getWorkspace()->getBaseWorkspace();
     }
     if (!$targetWorkspace instanceof Workspace) {
         return;
     }
     $nodes = array($node);
     $nodeType = $node->getNodeType();
     if ($nodeType->isOfType('Neos.Neos:Document') || $nodeType->hasConfiguration('childNodes')) {
         foreach ($node->getChildNodes('Neos.Neos:ContentCollection') as $contentCollectionNode) {
             array_push($nodes, $contentCollectionNode);
         }
     }
     $sourceWorkspace = $node->getWorkspace();
     $sourceWorkspace->publishNodes($nodes, $targetWorkspace);
     $this->emitNodePublished($node, $targetWorkspace);
 }
All Usage Examples Of Neos\ContentRepository\Domain\Model\NodeInterface::getChildNodes