Neos\ContentRepository\Domain\Repository\NodeDataRepository::findFirstByParentAndNodeType PHP Method

findFirstByParentAndNodeType() public method

Finds a single node by its parent and (optionally) by its node type
public findFirstByParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions, boolean $removedNodes = false ) : 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)
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array
$removedNodes boolean If TRUE the result has ONLY removed nodes. If FALSE removed nodes are NOT inside the result. If NULL the result contains BOTH removed and non-removed nodes. (defaults to FALSE)
return Neos\ContentRepository\Domain\Model\NodeData The node found or NULL
    public function findFirstByParentAndNodeType($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions, $removedNodes = false)
    {
        $nodes = $this->findByParentAndNodeType($parentPath, $nodeTypeFilter, $workspace, $dimensions, $removedNodes);
        if ($nodes !== []) {
            return reset($nodes);
        }
        return null;
    }