Neos.ContentRepository/Classes/Domain/Service/Context.php
public function getNodeVariantsByIdentifier($identifier)
    {
        $nodeVariants = [];
        $nodeDataElements = $this->nodeDataRepository->findByIdentifierWithoutReduce($identifier, $this->getWorkspace());
        /** @var NodeData $nodeData */
        foreach ($nodeDataElements as $nodeData) {
            $contextProperties = $this->getProperties();
            $contextProperties['dimensions'] = $nodeData->getDimensionValues();
            unset($contextProperties['targetDimensions']);
            $adjustedContext = $this->contextFactory->create($contextProperties);
            $nodeVariant = $this->nodeFactory->createFromNodeData($nodeData, $adjustedContext);
            $nodeVariants[] = $nodeVariant;
        }
        return $nodeVariants;
    }
public function getNodeVariantsByIdentifier($identifier)
    {
        $nodeVariants = [];
        $nodeDataElements = $this->nodeDataRepository->findByIdentifierWithoutReduce($identifier, $this->getWorkspace());
        /** @var NodeData $nodeData */
        foreach ($nodeDataElements as $nodeData) {
            $contextProperties = $this->getProperties();
            $contextProperties['dimensions'] = $nodeData->getDimensionValues();
            unset($contextProperties['targetDimensions']);
            $adjustedContext = $this->contextFactory->create($contextProperties);
            $nodeVariant = $this->nodeFactory->createFromNodeData($nodeData, $adjustedContext);
            $nodeVariants[] = $nodeVariant;
        }
        return $nodeVariants;
    }
public function getNodeVariantsByIdentifier ( $ identifier ) { $ nodeVariants = [ ] ; $ nodeDataElements = $ this -> nodeDataRepository -> findByIdentifierWithoutReduce ( $ identifier , $ this -> getWorkspace ( ) ) ; /** @var NodeData $nodeData */ foreach ( $ nodeDataElements as $ nodeData ) { $ contextProperties = $ this -> getProperties ( ) ; $ contextProperties [ 'dimensions' ] = $ nodeData -> getDimensionValues ( ) ; unset ( $ contextProperties [ 'targetDimensions' ] ) ; $ adjustedContext = $ this -> contextFactory -> create ( $ contextProperties ) ; $ nodeVariant = $ this -> nodeFactory -> createFromNodeData ( $ nodeData , $ adjustedContext ) ; $ nodeVariants [ ] = $ nodeVariant ; } return $ nodeVariants ; }
Get all node variants for the given identifier

A variant of a node can have different dimension values and path (for non-aggregate nodes).
The resulting node instances might belong to a different context.

@param string $identifier The identifier of a node
@return array<\Neos\ContentRepository\Domain\Model\NodeInterface>
Get all node variants for the given identifier