@param NodeInterface $node
@param array         $params

@return FacadeInterface

@throws TransformerParameterTypeException
777907
public function transform($node, array $params = array())
    {
        if (!$node instanceof NodeInterface) {
            throw new TransformerParameterTypeException();
        }

        $facade = $this->newFacade();

        $facade = $this->addMainAttributes($facade, $node);
        $facade = $this->addAreas($facade, $node);
        $facade = $this->addStatus($facade, $node);
        $facade = $this->addPreviewLinks($facade, $node);

        return $facade;
    }
28153
private function hydrateReferenceField(
        NodeInterface $node,
        $document,
        DocumentAccessor $accessor,
        $fieldName,
        $locale,
        array $fieldMapping,
        array $options
    ) {
        try {
            $phpcrName = $this->encoder->encode($fieldMapping['encoding'], $fieldMapping['property'], $locale);
            $referencedNode = $node->getPropertyValueWithDefault(
                $phpcrName,
                $this->getDefaultValue($fieldMapping)
            );

            if ($referencedNode) {
                $accessor->set(
                    $fieldName,
                    $this->proxyFactory->createProxyForNode($document, $referencedNode, $options)
                );
            }
        } catch (InvalidLocaleException $ex) {
            // arguments invalid, no valid propertyname could be generated (e.g. no locale given for localized encoding)
            return;
        }
    }
987371
public static function transformer(TransformerInterface $transformer, array $params): array
    {
        if (empty($params)) {
            return $params;
        }

        try {
            list($extra, $variadic) = self::interpretFunction(
                new \ReflectionMethod($transformer, 'transform'),
                $params
            );

            list($args) = self::interpretFunction(
                new \ReflectionMethod($transformer, '__invoke'),
                $params
            );

            return array_merge(
                $args,
                $extra,
                $variadic
            );
        } catch (\ReflectionException $e) {
            // Sorry
        }

        return [];
    }
243362
public function registerNode(NodeInterface $node)
    {
        $nodeId = $node->getId();
        if (isset(static::$nodes[$nodeId])) {
            throw new NodalFlowException('Duplicate Node instances are not allowed', 1, null, [
                'nodeClass' => get_class($node),
                'nodeId'    => $nodeId,
            ]);
        }

        static::$nodes[$nodeId] = $node;

        return $this;
    }
1319823
protected function addAreas(FacadeInterface $facade, NodeInterface $node)
    {
        if ($this->hasGroup(CMSGroupContext::AREAS)) {
            foreach ($node->getAreas() as $key => $area) {
                $facade->setAreas($this->getContext()->transform('area', $area), $key);
            }
        }

        return $facade;
    }
831004
public function createChildNodes(NodeInterface $node)
    {
        $nodeType = $node->getNodeType();
        foreach ($nodeType->getAutoCreatedChildNodes() as $childNodeName => $childNodeType) {
            try {
                $node->createNode($childNodeName, $childNodeType);
            } catch (NodeExistsException $exception) {
                // If you have a node that has been marked as removed, but is needed again
                // the old node is recovered
                $childNodePath = NodePaths::addNodePathSegment($node->getPath(), $childNodeName);
                $contextProperties = $node->getContext()->getProperties();
                $contextProperties['removedContentShown'] = true;
                $context = $this->contextFactory->create($contextProperties);
                $childNode = $context->getNode($childNodePath);
                if ($childNode->isRemoved()) {
                    $childNode->setRemoved(false);
                }
            }
        }
    }
238809
public function setNode(NodeInterface $node = null)
    {
        $this->node = $node;

        if ($node->getMenu() !== $this) {
            $node->setMenu($this);
        }

        return $this;
    }
722137
public function setNode(NodeInterface $node)
    {
        $this->nodeIdentifier = $node->getIdentifier();
        $this->workspaceName = $node->getContext()->getWorkspaceName();
        $this->dimension = $node->getContext()->getDimensions();

        $context = $node->getContext();
        if ($context instanceof ContentContext && $context->getCurrentSite() !== null) {
            $siteIdentifier = $this->persistenceManager->getIdentifierByObject($context->getCurrentSite());
        } else {
            $siteIdentifier = null;
        }
        $this->data = Arrays::arrayMergeRecursiveOverrule($this->data, [
            'nodeContextPath' => $node->getContextPath(),
            'nodeLabel' => $node->getLabel(),
            'nodeType' => $node->getNodeType()->getName(),
            'site' => $siteIdentifier
        ]);

        $node = self::getClosestAggregateNode($node);

        if ($node !== null) {
            $this->documentNodeIdentifier = $node->getIdentifier();
            $this->data = Arrays::arrayMergeRecursiveOverrule($this->data, [
                'documentNodeContextPath' => $node->getContextPath(),
                'documentNodeLabel' => $node->getLabel(),
                'documentNodeType' => $node->getNodeType()->getName()
            ]);
        }
    }
429179
protected function interruptNode(NodeInterface $node)
    {
        // if we have an interruptNodeId, bubble up until we match a node
        // else stop propagation
        return $this->interruptNodeId ? $this->interruptNodeId !== $node->getId() : false;
    }
1239614
protected function parseNodeProperties(NodeInterface $node)
    {
        $properties = [];

        // Run through all node properties
        foreach ($node->getProperties() as $name => $property) {
            // Skip the node type
            if ($name === Node::TYPE) {
                continue;
            }

            // Initialize the property (if necessary)
            $this->initializeNodeProperty($name, $properties);

            // Parse and process the property value
            $this->processNodeProperty($name, $this->parse($property), $properties);
        }

        return $properties;
    }
47794
public function addNode(NodeInterface $node): NodeInterface
    {
        $this->_nodes[$node->getId()] = $node;

        if ($this->getParent()) {
            $this->getParent()->addNode($node);
        }

        return $this;
    }
427385
public function validateNode(NodeInterface $node): Asserts
    {
        return $this->validate(XmlNodeUtils::nodeToXmlString($node), $node);
    }
1085425
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Stmt\Use_ || ! $parent instanceof PhpFileModelInterface) {
            throw new Exception('UseNodeParser is made to parse a use node');
        }

        if ($node->type === Node\Stmt\Use_::TYPE_NORMAL) {
            foreach ($node->uses as $use) {
                $parent->addUse($use->getAlias()->name, $use->name->toString());
            }
        }
    }
769594
public function addToArrayNode(AbstractNode $node): QueryBuilderInterface
    {
        if (!$this->node instanceof ArrayNode) {
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
        }

        $this->node->add($node);
        $this->reassignParent($node);

        return $this;
    }
42209
public function add(Node\NodeInterface $node)
	{
		$node->setRepository($this);
		parent::add($node);
		$this->array[] = $node;
	}
1184796
public function withParams(array $params): ParamHolderInterface
    {
        $param_holder = clone $this;
        $param_holder->params = array_merge($param_holder->params, $params);
        return $param_holder;
    }
833540
public function addNode(NodeInterface $node)
    {
        if ($this->checkChildNode($node)) {
            $this->nodes->add($node);

            $node->setPosition(count($this->getNodes()));
            $node->setParent($this);
        }

        return $this;
    }