findFirstByParentAndNodeTypeInContext() public method

Finds a single node by its parent and (optionally) by its node type
public findFirstByParentAndNodeTypeInContext ( string $parentPath, string $nodeTypeFilter, Context $context ) : NodeData
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$context Neos\ContentRepository\Domain\Service\Context The containing context
return Neos\ContentRepository\Domain\Model\NodeData The node found or NULL
示例#1
0
 /**
  * Returns the primary child node of this node.
  *
  * Which node acts as a primary child node will in the future depend on the
  * node type. For now it is just the first child node.
  *
  * @return Node The primary child node or NULL if no such node exists
  * @api
  */
 public function getPrimaryChildNode()
 {
     return $this->nodeDataRepository->findFirstByParentAndNodeTypeInContext($this->getPath(), null, $this->context);
 }