Retrieves referenced Camp node for the node.

@param \Drupal\node\NodeInterface $node
The node.

@return \Drupal\node\NodeInterface|null
Camp node or NULL.
183253
public function getNodeCampNode(NodeInterface $node) {
    $camp = NULL;
    if ($camp_service = $this->container->get('openy_loc_camp.camp_service')) {
      $camp = $camp_service->getNodeCampNode($node);
    }

    return $camp;
  }
388124
public function getChildrenNodes(Node $node)
    {
        $result = $this->search($node->getDn(), null, false);

        $nodes = array();
        foreach ($result as $node) {
            $nodes[] = $node;
        }

        return $nodes;
    }
157110
public function enrollDialog(NodeInterface $node) {
    $action_links = [
      'login' => [
        'uri' => Url::fromRoute('user.login', [], [
          'query' => [
            'destination' => Url::fromRoute('entity.node.canonical', ['node' => $node->id()])
              ->toString(),
          ],
        ])->toString(),
      ],
      'register' => [
        'uri' => Url::fromRoute('user.register', [], [
          'query' => [
            'destination' => Url::fromRoute('entity.node.canonical', ['node' => $node->id()])
              ->toString(),
          ],
        ])->toString(),
      ],
      'guest' => [
        'uri' => Url::fromRoute('social_event_an_enroll.enroll_form', ['node' => $node->id()], [])
          ->toString(),
      ],
    ];

    $output = [
      '#theme' => 'event_an_enroll_dialog',
      '#links' => $action_links,
    ];

    return $output;
  }
1027762
public static function getPath(AlphabeticalTreeNodeInterface $node) {

        // Initialize the path.
        $path = [];

        // Save the node.
        $current = $node;

        // Handle each parent.
        do {
            array_unshift($path, $current);
            $current = $current->getAlphabeticalTreeNodeParent();
        } while (null !== $current);

        // Return the path.
        return $path;
    }
787766
public function getProperty(NodeInterface $node, $propertyName)
    {
        if ($propertyName[0] === '_') {
            $propertyValue = ObjectAccess::getProperty($node, ltrim($propertyName, '_'));
        } else {
            $propertyValue = $node->getProperty($propertyName);
        }

        $dataType = $node->getNodeType()->getPropertyType($propertyName);
        try {
            $convertedValue = $this->convertValue($propertyValue, $dataType);
        } catch (PropertyException $exception) {
            $logMessage = $this->throwableStorage->logThrowable($exception);
            $this->logger->error($logMessage, LogEnvironment::fromMethodName(__METHOD__));
            $convertedValue = null;
        }

        if ($convertedValue === null) {
            $convertedValue = $this->getDefaultValueForProperty($node->getNodeType(), $propertyName);
            if ($convertedValue !== null) {
                try {
                    $convertedValue = $this->convertValue($convertedValue, $dataType);
                } catch (PropertyException $exception) {
                    $logMessage = $this->throwableStorage->logThrowable($exception);
                    $this->logger->error($logMessage, LogEnvironment::fromMethodName(__METHOD__));
                    $convertedValue = null;
                }
            }
        }

        return $convertedValue;
    }
391301
private function getDocumentFromNode(NodeInterface $node)
    {
        $metadata = $this->metadataFactory->getMetadataForPhpcrNode($node);

        return $this->instantiateFromMetadata($metadata);
    }
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;
    }
836700
public function hydrateNodeFromNodeId(NodeInterface $node, $nodeId)
    {
        $siteId = $this->contextManager->getSiteId();
        $oldNode = $this->nodeRepository->findInLastVersion($nodeId, $node->getLanguage(), $siteId);
        if ($oldNode) {
            $node->setTemplate($oldNode->getTemplate());
            $this->duplicateArea($oldNode, $node);
        }

        return $node;
    }
758244
public function setVersionName(NodeInterface $node)
    {
        $date = new \DateTime("now");
        $versionName = $node->getName() . '_' . $date->format("Y-m-d_H:i:s");
        $node->setVersionName($versionName);

        return $node;
    }
512427
protected function parseNode(NodeInterface $node)
    {
        return (object)[
            'type'       => $this->parseNodeType($node),
            'id'         => $node->getId() ?: null,
            'properties' => $this->parseNodeProperties($node),
        ];
    }
208454
public static function getBranchesList(NodeInterface $node) {
    $branches_list = [
      'branch' => [],
      'camp' => [],
    ];

    if (!\Drupal::hasService('session_instance.manager')) {
      return $branches_list;
    }

    $locations = \Drupal::service('session_instance.manager')
      ->getLocationsByClassNode($node);
    foreach ($locations as $location) {
      if (!isset($branches_list[$location->bundle()][$location->id()])) {
        $branches_list[$location->bundle()][$location->id()] = $location->title->value;
      }
    }

    return $branches_list;
  }
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);
        }
    }
732847
public function getNodeCampaignNode(NodeInterface $node) {
    $campaign = NULL;

    if ($node->getType() == 'campaign') {
      return $node;
    }

    if ($node->getType() == 'campaign_page') {
      $campaign = $node->field_campaign_parent->entity;
      if (!empty($campaign)) {
        return $campaign;
      }
    }

    /** @var \Drupal\node\NodeStorage $nodeStorage */
    $nodeStorage = $this->entityTypeManager->getStorage('node');

    // Get Campaign node with reference to given Landing page node.
    /** @var \Drupal\Core\Entity\Query\QueryInterface $query */
    $query = $nodeStorage->getQuery()
      ->condition('status', 1)
      ->condition('type', 'campaign');
    $orGroup = $query->orConditionGroup()
      ->condition('field_campaign_pages', $node->id(), 'IN')
      ->condition('field_pause_landing_page', $node->id());
    $nids = $query->condition($orGroup)->execute();

    /** @var \Drupal\node\NodeInterface $campaign */
    $campaign = $nodeStorage->load(reset($nids));

    return $campaign;
  }
173506
public function removeNode(NodeInterface $node): NodeInterface
    {
        unset($this->_nodes[$node->getId()]);

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

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

        return $this->nodeDocumentMap[$this->getNodeLocaleKey($node->getIdentifier(), $locale)];
    }
979662
private function getChildren(NodeInterface $node)
    {
        $result = [];
        foreach ($node->getNodes() as $child) {
            $result[$child->getIdentifier()] = $child;
        }

        return $result;
    }