@param \Drupal\node\NodeInterface $node

@return array Render array
975992
public function showWinners(NodeInterface $node) {
    $winnersList = views_embed_view('campaign_winners', 'campaign_winners_page', $node->id());
    $winnersCalculateForm = $this->formBuilder()->getForm(WinnersCalculateForm::class, $node->id());

    $build = [
      'view' => $winnersList,
      'form' => $winnersCalculateForm,
    ];

    return $build;
  }
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())
        ];
    }
1008829
public function getSortValuesForNode(NodeInterface $node): array
    {
        $hit = $this->searchHitForNode($node);
        if (is_array($hit) && array_key_exists('sort', $hit)) {
            return $hit['sort'];
        }

        return [];
    }
554505
public function getData(NodeInterface $node = null, array $arguments)
    {
        $data = [];

        foreach ($this->parseListOfIcons() as $iconName) {
            $data['fa-' . $iconName] = [
                'label' => $iconName,
                'icon' => 'fa fa-' . $iconName,
            ];
        }

        return $data;
    }
141337
protected function renderNodeActions($node)
    {
        $lines = [];

        $nodeActionsOptions = $this->nodeActionsOptions;
        $tag = ArrayHelper::remove($nodeActionsOptions, 'tag', 'span');
        $lines[] = Html::beginTag($tag, $nodeActionsOptions);

        foreach ($this->nodeActions as $actionName => $actionValue) {
            $lines[] = $this->renderNodeAction($node, $actionName, $actionValue);
        }

        $lines[] =  Html::endTag($tag);

        return implode("\n", $lines);
    }
42209
public function add(Node\NodeInterface $node)
	{
		$node->setRepository($this);
		parent::add($node);
		$this->array[] = $node;
	}
926555
protected function useCaseNodeToDslText(NodeInterface $node)
    {
        $dslText = sprintf(
            $this->nodeTypeToDslText[Node::TYPE_USE_CASE],
            $this->getFilter()->filter($node->getNodeName())
        );

        return $dslText;
    }
480061
private static function extractProperties(NodeInterface $node)
    {
        $class = new \ReflectionClass($node);

        foreach ($class->getProperties() as $property) {
            if (!$property->isPublic()) {
                $property->setAccessible(true);
            }

            $name = $property->getName();
            $value = $property->getValue($node);

            yield $name => $value;

            if (!$property->isPublic()) {
                $property->setAccessible(false);
            }
        }
    }
249277
public function getData(NodeInterface $node = NULL, array $arguments) {
		$result = array();
		$result[''] = array(
			'label' => 'Please select a receiver group'
		);

		foreach ($this->receiverGroupRepository->findAll() as $receiverGroup) {
			/* @var $receiverGroup \Sandstorm\Newsletter\Domain\Model\ReceiverGroup */
			$result[$this->persistenceManager->getIdentifierByObject($receiverGroup)] = array(
				'label' => $receiverGroup->getFullLabel()
			);
		}
		return $result;
	}
1098127
protected function generateRoutesForNode(NodeInterface $node, ReadSiteInterface $site, array $routePattern)
    {
        $routes = array();

        if (!$node instanceof NodeInterface) {
            return $routes;
        }

        $routeDocumentClass = $this->routeDocumentClass;

        /** @var SiteAliasInterface $alias */
        foreach ($site->getAliases() as $key => $alias) {
            if ($alias->getLanguage() == $node->getLanguage()) {
                /** @var RouteDocumentInterface $route */
                $route = new $routeDocumentClass();
                $route->setName($key . '_' . $node->getId());
                $route->setHost($alias->getDomain());
                $scheme = $node->getScheme();
                if (is_null($scheme) || SchemeableInterface::SCHEME_DEFAULT == $scheme) {
                    $scheme = $alias->getScheme();
                }
                $route->setSchemes($scheme);
                $route->setLanguage($node->getLanguage());
                $route->setNodeId($node->getNodeId());
                $route->setSiteId($site->getSiteId());
                $route->setAliasId($key);
                $pattern = $this->completeRoutePattern($node->getParentId(), $node->getRoutePattern(), $node->getLanguage(), $site->getSiteId(), $routePattern);
                if ($alias->getPrefix()) {
                    $pattern = $this->suppressDoubleSlashes('/' . $alias->getPrefix() . '/' . $pattern);
                }
                $route->setPattern($pattern);
                $routes[] = $route;
            }
        }

        return $routes;
    }
747512
public function render( ElementInterface $element )
    {
        if ( ! $element instanceof TagListElement )
        {
            throw new Exception\InvalidArgumentException( sprintf(
                '%s requires that the element is of type Grid\Tag\Form\Element\TagList',
                __METHOD__
            ) );
        }

        $rendered       = '';
        $type           = $this->getInputType();
        $name           = static::getName( $element );
        $closingBracket = $this->getInlineClosingBracket();

        $hidden = sprintf(
            '<input %s%s',
            $this->createAttributesString( array(
                'type'  => 'hidden',
                'name'  => $element->getName(),
                'value' => '',
            ) ),
            $closingBracket
        );

        foreach ( $element->getValue() as $value )
        {
            $rendered .= sprintf(
                '<input %s%s',
                $this->createAttributesString( array(
                    'type'  => $type,
                    'name'  => $name,
                    'value' => $value,
                ) ),
                $closingBracket
            );
        }

        $attributes = $element->getAttributes();

        if ( empty( $attributes['class'] ) )
        {
            $attributes['class'] = '';
        }
        else
        {
            $attributes['class'] .= ' ';
        }

        $attributes['class'] .= 'tag_list';
        $attributes['data-name'] = $name;
        unset( $attributes['type'] );
        unset( $attributes['name'] );
        unset( $attributes['value'] );

        return sprintf(
            '%s<div %s>%s</div>',
            $hidden,
            $this->createAttributesString( $attributes ),
            $rendered
        );
    }
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;
    }
1166634
public function getLanguagesForNode(NodeInterface $node)
    {
        $languages = [];
        foreach ($node->getProperties() as $property) {
            /* @var PropertyInterface $property */
            preg_match('/^' . $this->languageNamespace . ':([a-zA-Z_]*?)-changer/', $property->getName(), $matches);

            if ($matches) {
                $languages[$matches[1]] = $matches[1];
            }
        }

        return array_values($languages);
    }
672114
public function generateCss(NodeInterface $node)
    {
        $css = '';

        foreach (self::PROPERTY_MAPPING as $key => $cssProperty) {
            // Get value, also check for `0` values using strlen()
            if (($value = $node->getProperty($key)) || strlen($value)) {
                // if numeric value is provided, add default unit (e.g. px)
                // but don't add it to zero values
                if ($value && is_numeric($value)) {
                    $value .= self::DEFAULT_UNIT;
                }

                $css .= "$cssProperty:$value;";
            }
        }

        return $css;
    }
427385
public function validateNode(NodeInterface $node): Asserts
    {
        return $this->validate(XmlNodeUtils::nodeToXmlString($node), $node);
    }
854651
protected function renderType(ElementInterface $element)
    {
        $value = $this->getElementValue($element);
        $type  = gettype($value);

        if (isset($this->typeMap[$type])) {
            return $this->renderHelper($this->typeMap[$type], $value, $element);
        }

        return;
    }
724136
public function createFromNode(NodeInterface $node)
    {
        $item = $this->createItem($node->getName(), $node->getOptions());
        /* @var $childNode NodeInterface */
        foreach ($node->getChildren() as $childNode) {
            $item->addChild($this->createFromNode($childNode));
        }

        return $item;
    }