Adds the given tree node to this nodes child list.

@param TreeNodeInterface $node The node to be inserted
@return void
3934
public function addChild(TreeNodeInterface $node): void
    {
        $this->children[] = $node;
        $this->isLeaf = false;
    }
54472
public function append(Node $node) : bool
    {
        $node->parent = $this;

        return $this->childNodes->add($node);
    }
791832
public function updateNode(TreeNodeInterface $node, $flush = true)
    {
        $node->setSiterootId($this->siterootId);

        $this->entityManager->persist($node);
        if ($flush) {
            $this->entityManager->flush($node);
        }

        return $this;
    }
480286
public void add(final T node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNext( node );
            node.setPrevious( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
799132
public function addChild(Node $child)
    {
        $this->children[]                           = $child;
        $child->parent                              = $this;
        $child->properties[$this->config['parent']] = $this->properties[$this->config['pk']];
    }
1019952
protected function finish(NodeInterface $node)
    {
        $this->persistenceManager->persistAll();

        $updateNodeInfo = new UpdateNodeInfo();
        $updateNodeInfo->setNode($node);
        $updateNodeInfo->recursive();

        $updateParentNodeInfo = new UpdateNodeInfo();
        $updateParentNodeInfo->setNode($node->getParent());

        $this->feedbackCollection->add($updateNodeInfo);
        $this->feedbackCollection->add($updateParentNodeInfo);

        $this->updateWorkspaceInfo();

        if ($node->getNodeType()->isOfType('Neos.Neos:Content') && ($this->getParentDomAddress() || $this->getSiblingDomAddress())) {

            // we can ONLY render out of band if:
            // 1) the parent of our new (or copied or moved) node is a ContentCollection; so we can directly update an element of this content collection
            if ($node->getParent()->getNodeType()->isOfType('Neos.Neos:ContentCollection') &&

                // 2) the parent DOM address (i.e. the closest RENDERED node in DOM is actually the ContentCollection; and
                //    no other node in between
                $this->getParentDomAddress() &&
                $this->getParentDomAddress()->getFusionPath() &&
                $this->getParentDomAddress()->getContextPath() === $node->getParent()->getContextPath()
            ) {
                $renderContentOutOfBand = new RenderContentOutOfBand();
                $renderContentOutOfBand->setNode($node);
                $renderContentOutOfBand->setParentDomAddress($this->getParentDomAddress());
                $renderContentOutOfBand->setSiblingDomAddress($this->getSiblingDomAddress());
                $renderContentOutOfBand->setMode($this->getMode());

                $this->feedbackCollection->add($renderContentOutOfBand);
            } else {
                $reloadDocument = new ReloadDocument();
                $reloadDocument->setNode($node);

                $this->feedbackCollection->add($reloadDocument);
            }
        }
    }
423657
private function buildRootNode($node, $tree, $level)
    {
        $node->setLevel($level);
        $tree[$node->getId()] = $node;
    }
942077
public function shift(TreeNodeInterface $node, int $stateIndex): void
    {
        $item = new StackItem();
        $item->state = $stateIndex;
        $item->node = $node;

        if ($this->actions) {
            $this->actions->applyToNode($node);
        }

        $this->items[] = $item;
        $this->stateIndex = $stateIndex;
        $this->stateRow = $this->table->getRow($stateIndex);
    }
259901
public void insertParentAfter(Node node) throws ChildNodeException {
    if (node != null) {
      // give this node my children
      node.setFirstChild(getFirstChild());

      setFirstChild(null); // clear our list
      addChild(node);      // make our child
    }
  }
789041
public function addChild(self $resourceNode)
    {
        if (!$this->children->contains($resourceNode)) {
            $this->children->add($resourceNode);
        }
    }
173506
public function removeNode(NodeInterface $node): NodeInterface
    {
        unset($this->_nodes[$node->getId()]);

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

        return $this;
    }
278106
public function setChildNodesByPathAndNodeTypeFilter($path, $nodeTypeFilter, array $nodes)
    {
        if (!isset($this->childNodesByPathAndNodeTypeFilter[$path])) {
            $this->childNodesByPathAndNodeTypeFilter[$path] = [];
        }

        foreach ($nodes as $node) {
            /** @var NodeInterface $node */
            $this->nodesByPath[$node->getPath()] = $node;
            $this->nodesByIdentifier[$node->getIdentifier()] = $node;
        }

        $this->childNodesByPathAndNodeTypeFilter[$path][$nodeTypeFilter] = $nodes;
    }
1188417
public function cutNode(NodeInterface $node)
    {
        $this->nodeContextPath = $node->getContextPath();
        $this->mode = self::MODE_MOVE;
    }
538737
public function invoke($node, NodeInterface $parent): void
    {
        if ($this->config->hasInterfaceParsing()) {
            if (! $node instanceof Node\Stmt\Interface_ || ! $parent instanceof PhpFileModelInterface) {
                throw new Exception('InterfaceNodeParser is made to parse an interface node');
            }

            $interface = new InterfaceModel();
            $interface->setParentNode($parent);
            $interface->setName(ClassLikeNameHelper::getName($node));
            $parent->addConcreteUse($parent->getFullNameFor($interface->getName()), $interface->getName());

            if (($documentation = $node->getDocComment()) !== null) {
                $this->documentationNodeParser->invoke($documentation, $interface);
            }

            $this->parseSubNodes($node->stmts, $interface);

            $parent->addInterface($interface);
        }
    }
326734
protected function pushChildNode(Element $node)
    {
        $node->attributes->addAttributeClass('page-item');

        if ($node->childNodes->first() instanceof Link) {
            $node->childNodes->first()->attributes->addAttributeClass('page-link');
        }

        parent::pushChildNode($node);
    }
390815
public function apply(AbstractNode $node): void
    {
        if (!$this->isPlugin($node)) {
            return;
        }

        $classNodeInterfaces = $node->getInterfaces();

        if (!$classNodeInterfaces->count()) {
            $message = sprintf(
                'The Plugin `%s` doesn\'t have any interfaces.',
                $node->getName()
            );
            $this->addViolation($node, [$message]);

            return;
        }

        $firstInterface = $classNodeInterfaces[0];

        if ($firstInterface === null) {
            return;
        }

        $interfaceReflection = new ReflectionClass($firstInterface->getNamespacedName());

        $this->verifyInterface($node, $interfaceReflection);
    }
749150
public function add(ElementInterface $element)
    {
        $id = $element->id;

        if ($id === null) $id = $this->generateId();

        $this->checkId($id);

        $this->objects[$id] = $element;
    }