Parse a JSON-LD node

@param NodeInterface $node Node

@return \stdClass Item
512427
protected function parseNode(NodeInterface $node)
    {
        return (object)[
            'type'       => $this->parseNodeType($node),
            'id'         => $node->getId() ?: null,
            'properties' => $this->parseNodeProperties($node),
        ];
    }
1329536
private function nodeToArray(DOMNode $node)
    {
        $xml = simplexml_import_dom($node, 'Nijens\\Utilities\\Configuration\\JSONSerializableXMLElement');
        $json = json_encode($xml);

        return json_decode($json, true);
    }
915529
public static function getClosestAggregateNode(NodeInterface $node)
    {
        while ($node !== null && !$node->getNodeType()->isAggregate()) {
            $node = $node->getParent();
        }
        return $node;
    }
1008829
public function getSortValuesForNode(NodeInterface $node): array
    {
        $hit = $this->searchHitForNode($node);
        if (is_array($hit) && array_key_exists('sort', $hit)) {
            return $hit['sort'];
        }

        return [];
    }
1188417
public function cutNode(NodeInterface $node)
    {
        $this->nodeContextPath = $node->getContextPath();
        $this->mode = self::MODE_MOVE;
    }
376517
protected function getBasicNodeInformation(NodeInterface $node): array
    {
        return [
            'contextPath' => $node->getContextPath(),
            'name' => $node->getName(),
            'identifier' => $node->getIdentifier(),
            'nodeType' => $node->getNodeType()->getName(),
            'label' => $node->getLabel(),
            'isAutoCreated' => $node->isAutoCreated(),
            'depth' => $node->getDepth(),
            'children' => [],
            'matchesCurrentDimensions' => ($node instanceof Node && $node->dimensionsAreMatchingTargetDimensionValues())
        ];
    }
554325
public function getNodeSegment(NodeInterface $node) : ?string
    {
        if ($node->isNew()) {
            return null;
        }

        if ($this->isNodeBlacklisted($node)) {
            return null;
        }

        $map = $this->getNodeAliasMap([$node->id()]);

        if ($map) {
            return reset($map);
        }
    }
872138
public function getPropertiesArray(NodeInterface $node)
    {
        $properties = [];
        foreach ($node->getNodeType()->getProperties() as $propertyName => $propertyConfiguration) {
            if ($propertyName[0] === '_' && $propertyName[1] === '_') {
                // skip fully-private properties
                continue;
            }

            $properties[$propertyName] = $this->getProperty($node, $propertyName);
        }

        return $properties;
    }
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;
    }
18232
public function getTemplate(TemplatableNodeInterface $node)
    {

        $template = $node->getTemplate();

        if (!$template) {

            $meta = $this->manager->getClassMetadata(get_class($node));

            if (!empty($this->templates[$meta->name]) && count($this->templates[$meta->name]) > 0)
                $template = reset($this->templates[$meta->name]);

            else {
                $name = trim(str_replace($meta->namespace, '', $meta->name), '\\');
                $bundleName = $this->getBundleNameFromEntity($meta->namespace, $this->container->get('kernel')->getBundles());
                $template = $this->getDefaultTemplate($name, $bundleName);
            }
        }

        return $template;

    }
1288839
public static function dump(NodeInterface $node)
	{
		$prefix = str_repeat(static::DUMP_PREFIX, $node->getLevel());
		$left = $node->getLeftValue();
		$right = $node->getRightValue();
		$level = $node->getLevel();
		$title = $node->getNodeTitle();
		$dumpData = array(
			static::DUMP_PREFIX_POS => $prefix,
			static::DUMP_LEFT_POS => $left,
			static::DUMP_RIGHT_POS => $right,
			static::DUMP_LEVEL_POS => $level,
			static::DUMP_TITLE_POS => $title
		);
		ksort($dumpData);
		$dumpString = vsprintf(static::DUMP_FORMAT, $dumpData);
		
		return $dumpString;
	}
927665
protected function findNodeIndex(Node $node)
    {

        foreach ($this->data as $i=>$added) {
            if ($added->getId() == $node->getId()) {
                return $i;
            }
        }

        // Not found? try it by spl_object_hash
        $nodeHash = spl_object_hash($node);

        foreach ($this->data as $i=>$added) {
            if (spl_object_hash($added) == $nodeHash) {
                return $i;
            }
        }

        return null;

    }
427385
public function validateNode(NodeInterface $node): Asserts
    {
        return $this->validate(XmlNodeUtils::nodeToXmlString($node), $node);
    }
1066590
private static function extract(NodeInterface $node)
    {
        $attributes = [];
        $nodes = [];

        foreach (self::extractProperties($node) as $name => $value) {
            if (is_array($value)) {
                foreach ($value as $item) {
                    if ($item instanceof NodeInterface) {
                        $nodes[$name][] = $item;
                    } else {
                        $attributes[$name][] = $item;
                    }
                }
            } else {
                if ($value instanceof NodeInterface) {
                    $nodes[$name] = $value;
                } else {
                    $attributes[$name] = $value;
                }
            }
        }

        return [$attributes, $nodes];
    }
579609
public function getDocumentForNode(NodeInterface $node, $locale)
    {
        $identifier = $node->getIdentifier();
        $this->assertNodeExists($identifier);

        return $this->nodeDocumentMap[$this->getNodeLocaleKey($node->getIdentifier(), $locale)];
    }
460986
public function copyNode(NodeInterface $node)
    {
        $this->nodeContextPath = $node->getContextPath();
        $this->mode = self::MODE_COPY;
    }
661890
public function getNodeCampaignMenu(NodeInterface $node) {
    if (!($campaign = $this->getNodeCampaignNode($node))) {
      return [];
    }

    return $this->getCampaignNodeCampaignMenu($campaign);
  }