Neos\ContentRepository\Domain\Model\NodeType::getNodeLabelGenerator PHP Method

getNodeLabelGenerator() public method

Return the node label generator class for the given node
public getNodeLabelGenerator ( ) : Neos\ContentRepository\Domain\Model\NodeLabelGeneratorInterface
return Neos\ContentRepository\Domain\Model\NodeLabelGeneratorInterface
    public function getNodeLabelGenerator()
    {
        $this->initialize();
        if ($this->nodeLabelGenerator === null) {
            if ($this->hasConfiguration('label.generatorClass')) {
                $nodeLabelGenerator = $this->objectManager->get($this->getConfiguration('label.generatorClass'));
            } elseif ($this->hasConfiguration('label') && is_string($this->getConfiguration('label'))) {
                $nodeLabelGenerator = $this->objectManager->get(\Neos\ContentRepository\Domain\Model\ExpressionBasedNodeLabelGenerator::class);
                $nodeLabelGenerator->setExpression($this->getConfiguration('label'));
            } else {
                $nodeLabelGenerator = $this->objectManager->get(\Neos\ContentRepository\Domain\Model\NodeLabelGeneratorInterface::class);
            }
            // TODO: Remove after deprecation phase of NodeDataLabelGeneratorInterface
            if ($nodeLabelGenerator instanceof NodeDataLabelGeneratorInterface) {
                $adaptor = new NodeDataLabelGeneratorAdaptor();
                $adaptor->setNodeDataLabelGenerator($nodeLabelGenerator);
                $nodeLabelGenerator = $adaptor;
            }
            $this->nodeLabelGenerator = $nodeLabelGenerator;
        }
        return $this->nodeLabelGenerator;
    }