Creates a new eZContentObjectTrashNode based on an eZContentObjectTreeNode

@param eZContentObjectTreeNode $node
@return eZContentObjectTrashNode
345687
static function createFromNode( $node )
    {
        $row = array( 'node_id' => $node->attribute( 'node_id' ),
                      'parent_node_id' => $node->attribute( 'parent_node_id' ),
                      'main_node_id' => $node->attribute( 'main_node_id' ),
                      'contentobject_id' => $node->attribute( 'contentobject_id' ),
                      'contentobject_version' => $node->attribute( 'contentobject_version' ),
                      'contentobject_is_published' => $node->attribute( 'contentobject_is_published' ),
                      'depth' => $node->attribute( 'depth' ),
                      'sort_field' => $node->attribute( 'sort_field' ),
                      'sort_order' => $node->attribute( 'sort_order' ),
                      'priority' => $node->attribute( 'priority' ),
                      'modified_subnode' => $node->attribute( 'modified_subnode' ),
                      'path_string' => $node->attribute( 'path_string' ),
                      'path_identification_string' => $node->attribute( 'path_identification_string' ),
                      'remote_id' => $node->attribute( 'remote_id' ),
                      'is_hidden' => $node->attribute( 'is_hidden' ),
                      'is_invisible' => $node->attribute( 'is_invisible' ),
                      'trashed' => time() );

        $trashNode = new eZContentObjectTrashNode( $row );
        return $trashNode;
    }
24092
static function concatTextContent( $node )
    {
        $retString = '';
        if ( !( $node instanceof DOMNode ) )
        {
            return $retString;
        }
        if ( $node->hasChildNodes() )
        {
            $childArray = $node->childNodes;
            foreach ( $childArray as $child )
            {
                $retString .= eZXMLTextType::concatTextContent( $child );
            }
        }
        elseif ( $node->nodeType === XML_TEXT_NODE )
        {
            return $node->textContent . ' ';
        }
        return $retString;
    }
744070
public static function createFromXML( DOMElement $node )
    {
        $newObj = new eZPageZone();

        if ( $node->hasAttributes() )
        {
            foreach ( $node->attributes as $attr )
            {
                if ( $attr->name == 'id' )
                {
                    $value = explode( '_', $attr->value );
                    $newObj->setAttribute( $attr->name, $value[1] );
                }
                else
                {
                    $newObj->setAttribute( $attr->name, $attr->value );
                }
            }
        }

        foreach ( $node->childNodes as $node )
        {
            if ( $node->nodeType == XML_ELEMENT_NODE && $node->nodeName == 'block' )
            {
                $blockNode = eZPageBlock::createFromXML( $node );
                $newObj->addBlock( $blockNode );
            }
            elseif ( $node->nodeType == XML_ELEMENT_NODE )
            {
                $newObj->setAttribute( $node->nodeName, $node->nodeValue );
            }
        }

        return $newObj;
    }
56628
private function createTrait(Trait_ $node)
    {
        $ref = new RefClass();

        $ref->isTrait    = true;
        $ref->fileName   = $this->file;
        $ref->name       = $this->getFullClassName((string)$node->name);
        $ref->docComment = $this->createDocComment($node);

        $ref->startLine = $node->getLine();

        return $ref;
    }
1244070
public function mutate(Node $node)
    {
        return new Node\Stmt\Return_(
            new Node\Expr\ConstFetch(new Node\Name('null'))
        );
    }
246718
public function getExpandedTree(Node ...$nodes): MerkleTree
    {
        $thisTree = $this->nodes;
        foreach ($nodes as $node) {
            $thisTree []= $node;
        }
        return (new MerkleTree(...$thisTree))
            ->setHashSize($this->outputSize)
            ->setPersonalizationString($this->personalization);
    }
938072
public function createForNode(NodeInterface $node)
    {
        $site = $this->siteRepository->findOneBySiteId($node->getSiteId());
        $nodes = $this->nodeRepository->findPublishedByPathAndLanguage($node->getPath(), $site->getSiteId(), $node->getLanguage());

        $routePattern = $this->nodeRepository->findAllRoutePattern($node->getLanguage(), $site->getSiteId());
        $routePattern = $this->computeRoutePattern($routePattern);
        $routes = array();

        foreach ($nodes as $node) {
            $routes = array_merge($this->generateRoutesForNode($node, $site, $routePattern), $routes);
        }

        return $routes;
    }
225254
public function addChild(TreeNodeInterface $node)
    {
        $this->children[] = $node;
        $node->setParent($this);

        return $this;
    }
185292
public function enterNode(Node $node)
    {
        if ($node instanceof Dir) {
            return new FuncCall(new Name('getcwd'), [], $node->getAttributes());
        } elseif ($node instanceof File) {
            return new String_('', $node->getAttributes());
        }
    }
63933
public function enterNode(Node $node)
    {
        if ($node instanceof DirNode) {
            if ($this->skip) {
                throw new DirConstantException();
            }

            return new StringNode($this->getDir());
        }
    }
686809
function copy(DOMNode $node)
    {
        $frame = new Frame($node);
        $frame->set_style(clone $this->_frame->get_original_style());

        return Factory::decorate_frame($frame, $this->_dompdf, $this->_root);
    }
1339425
protected function traverseNode(Node $node) : Node
    {
        foreach ($node->getSubNodeNames() as $name) {
            $subNode =& $node->$name;

            if (\is_array($subNode)) {
                $subNode = $this->traverseArray($subNode);
                if ($this->stopTraversal) {
                    break;
                }
            } elseif ($subNode instanceof Node) {
                $traverseChildren = true;
                foreach ($this->visitors as $visitor) {
                    $return = $visitor->enterNode($subNode, $traverseChildren);
                    if (null !== $return) {
                        if ($return instanceof Node) {
                            $subNode = $return;
                        } elseif (self::DONT_TRAVERSE_CHILDREN === $return) {
                            $traverseChildren = false;
                        } elseif (self::STOP_TRAVERSAL === $return) {
                            $this->stopTraversal = true;
                            break 2;
                        } else {
                            throw new \LogicException(
                                'enterNode() returned invalid value of type ' . gettype($return)
                            );
                        }
                    }
                }

                if ($traverseChildren) {
                    $subNode = $this->traverseNode($subNode);
                    if ($this->stopTraversal) {
                        break;
                    }
                }

                foreach ($this->visitors as $visitor) {
                    $return = $visitor->leaveNode($subNode);
                    if (null !== $return) {
                        if ($return instanceof Node) {
                            $subNode = $return;
                        } elseif (self::STOP_TRAVERSAL === $return) {
                            $this->stopTraversal = true;
                            break 2;
                        } elseif (\is_array($return)) {
                            throw new \LogicException(
                                'leaveNode() may only return an array ' .
                                'if the parent structure is an array'
                            );
                        } else {
                            throw new \LogicException(
                                'leaveNode() returned invalid value of type ' . gettype($return)
                            );
                        }
                    }
                }
            }
        }

        return $node;
    }
1165412
public function addToObjectNode(string $key, AbstractNode $node): QueryBuilderInterface
    {
        if (!$this->node instanceof ObjectNode) {
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
        }

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

        return $this;
    }
1254966
public function createRoot(Node $node)
    {
        if($node instanceof NodeWrapper)
        {
            throw new \InvalidArgumentException('Can\'t create a root node from a NodeWrapper node');
        }

        $node->setLeftValue(1);
        $node->setRightValue(2);

        if($this->getConfiguration()->hasManyRoots())
        {
            $rootValue = $node->getId();
            if($rootValue === null)
            {
                // Set a temporary value in case wrapped node requires root value to be set
                $node->setRootValue(0);
                $this->getEntityManager()->persist($node);
                $this->getEntityManager()->flush();
                $rootValue = $node->getId();
            }

            if($rootValue === null)
            {
                // @codeCoverageIgnoreStart
                throw new \RuntimeException('Node must have an identifier available via getId()');
                // @codeCoverageIgnoreEnd
            }

            $node->setRootValue($rootValue);
        }


        $this->getEntityManager()->persist($node);
        $this->getEntityManager()->flush();

        return $this->wrapNode($node);
    }
1150986
function createContentObjectAttributeDOMNode( $objectAttribute )
    {
        $dom = new DOMDocument( '1.0', 'utf-8' );

        $node = $dom->createElementNS( 'http://ez.no/object/', 'ezobject:attribute' );

        $node->setAttributeNS( 'http://ez.no/ezobject', 'ezremote:id', $objectAttribute->attribute( 'id' ) );
        $node->setAttributeNS( 'http://ez.no/ezobject', 'ezremote:identifier', $objectAttribute->contentClassAttributeIdentifier() );
        $node->setAttribute( 'name', $objectAttribute->contentClassAttributeName() );
        $node->setAttribute( 'type', $this->isA() );

        return $node;
    }
581337
public static function Create( $context, $node )
	{
		if ( is_a( $node, __CLASS__ ) )
		{
			/**
			 * @var PathStep $res
			 */
			$res = $node;
			return $res;
		}

		if ( $node instanceof PathExprNode )
		{
			/**
			 * @var PathExprNode $pathExpr
			 */
			$pathExpr = $node;
			return $pathExpr->FirstStep;
		}

		return PathStep::fromNode( AbstractNode::Create( $context, $node ) );
	}
519276
public function append(Node $node)
    {

        if (!is_array($this->_children)) {
            $this->_children = [];
        }

        $this->_children[] = $node;
        return $this;
    }