Apply this template to the given node while providing context for EEL processing

@param NodeInterface $node
@param array $context
172912
public function apply(NodeInterface $node, array $context)
    {
        $context['node'] = $node;

        // Check if this template should be applied at all
        if (!$this->isApplicable($context)) {
            return;
        }
        $this->setProperties($node, $context);

        // Create child nodes if applicable
        /** @var Template $childNodeTemplate */
        foreach ($this->childNodes as $childNodeTemplate) {
            $childNodeTemplate->createOrFetchAndApply($node, $context);
        }

        $this->emitNodeTemplateApplied($node, $context, $this->options);
    }
815234
public function belongsTo(NodeInterface $node)
	{
		$this->masterNode = $node;
		$this->refresh();
		
		if ($node instanceof NodeLeafInterface) {
			$this->setLeafInterface(true);
		}
	}
404774
public function render(array $data, ContextInterface $context)
    {
        $data = $this->applyButtonClasses($data);

        return parent::render($data, $context);
    }
1239698
protected function applyNodeCreationHandlers(NodeInterface $node)
    {
        $data = $this->getData() ?: [];
        $nodeType = $node->getNodeType();
        if (isset($nodeType->getOptions()['nodeCreationHandlers'])) {
            $nodeCreationHandlers = $nodeType->getOptions()['nodeCreationHandlers'];
            if (is_array($nodeCreationHandlers)) {
                foreach ($nodeCreationHandlers as $nodeCreationHandlerConfiguration) {
                    $nodeCreationHandler = new $nodeCreationHandlerConfiguration['nodeCreationHandler']();
                    if (!$nodeCreationHandler instanceof NodeCreationHandlerInterface) {
                        throw new InvalidNodeCreationHandlerException(sprintf('Expected NodeCreationHandlerInterface but got "%s"', get_class($nodeCreationHandler)), 1364759956);
                    }
                    $nodeCreationHandler->handle($node, $data);
                }
            }
        }

        $this->emitNodeCreationHandlersApplied($node);
    }
164570
public function clearForNode(NodeInterface $node)
    {
        $nodeIds = $this->nodeRepository->findNodeIdByIncludedPathSiteIdAndLanguage(
            $node->getPath(),
            $node->getSiteId(),
            $node->getLanguage()
        );

        $this->routeDocumentRepository->removeByNodeIdsSiteIdAndLanguage($nodeIds, $node->getSiteId(), $node->getLanguage());
    }
792380
public function apply(AbstractNode $node)
    {
        if (preg_match('([A-Za-z0-9]+Bridge$)', $node->getName()) === 0 ||
            preg_match('#.*\\\\Dependency\\\\.*#', $node->getNamespaceName()) === 0) {
            return;
        }

        preg_match('#(?<moduleName>[\w]+)\\\\Dependency\\\\(?<layerName>[\w]+)#is', $node->getNamespaceName(), $namespaceParts);

        $this->verifyClass($node, $namespaceParts);
        $this->verifyInterface($node, $namespaceParts);
    }
465442
public function setProperty(NodeInterface $node, \DOMElement $element) : void
    {
        $node->setTitle($element->nodeValue);
    }
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);
            }
        }
    }
903181
public function initializeAreasNode(NodeInterface $node)
    {
        $site = $this->siteRepository->findOneBySiteId($node->getSiteId());
        $templateSet = $site->getTemplateSet();
        $areasName = $this->templateManager->getTemplateAreas($node->getTemplate(), $templateSet);
        foreach($areasName as $areaName) {
            if (! $node->getArea($areaName) instanceof AreaInterface) {
                $node->setArea($areaName, new $this->areaClass());
            }
        }

        return $node;
    }
514271
public function beforeAdoptNode(NodeInterface $node, Context $context, $recursive)
    {
        if (!$this->eventEmittingService->isEnabled()) {
            return;
        }

        if ($this->currentlyAdopting === 0) {
            /* @var $nodeEvent NodeEvent */
            $nodeEvent = $this->eventEmittingService->emit(self::NODE_ADOPT, [
                'targetWorkspace' => $context->getWorkspaceName(),
                'targetDimensions' => $context->getTargetDimensions(),
                'recursive' => $recursive
            ], NodeEvent::class);
            $nodeEvent->setNode($node);
            $this->eventEmittingService->pushContext();
        }

        $this->currentlyAdopting++;
    }
876175
protected function verifyInterface(ClassNode $node, ReflectionClass $interfaceReflection): void
    {
        $className = $node->getFullQualifiedName();
        $interfaceName = $interfaceReflection->getNamespaceName();

        $classModuleName = $this->getModuleName($className);

        if (!$classModuleName) {
            return;
        }

        $interfaceModuleName = $this->getModuleName($interfaceName);

        if ($classModuleName === $interfaceModuleName) {
            return;
        }

        if (preg_match('#Extension$#', $interfaceModuleName) !== 0) {
            return;
        }

        $this->addViolation(
            $node,
            [
                sprintf(
                    'The plugin class implements %s interface without participation of Extension module which violates rule "%s"',
                    $interfaceName,
                    static::RULE
                ),
            ]
        );
    }
535509
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Stmt\Class_ || ! $parent instanceof PhpFileModelInterface) {
            throw new Exception('ClassNodeParser is made to parse a class node');
        }
        $class = new ClassModel();
        $class->setParentNode($parent);
        $class->setName(ClassLikeNameHelper::getName($node));
        $class->setIsAbstract($node->isAbstract());
        $class->setIsFinal($node->isFinal());
        $parent->addConcreteUse($parent->getFullNameFor($class->getName()), $class->getName());

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

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

        $parent->addClass($class);
    }
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;
    }
47794
public function addNode(NodeInterface $node): NodeInterface
    {
        $this->_nodes[$node->getId()] = $node;

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

        return $this;
    }
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;
    }
1065768
public function apply(AbstractNode $node): void
    {
        if (!$this->isZedNamespace($node)) {
            return;
        }

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

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

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

        $allocatedClasses = $node->findChildrenOfType('AllocationExpression');

        if (count($allocatedClasses) === 0) {
            return;
        }

        foreach ($allocatedClasses as $allocatedClass) {
            $this->applyRule($allocatedClass, $node);
        }
    }
1275878
public function apply(AbstractNode $node): void
    {
        if (!$this->isRepository($node)) {
            return;
        }

        $classNodeTransfer = $this->getClassNodeTransfer($node);

        try {
            $methodTransferCollection = $this->getFacade()->getMethodTransferCollectionWithRelations($classNodeTransfer);
        } catch (InvalidArgumentException $e) {
            /*
             * DocBlock exception Spryker\Zed\SalesStatistics\Persistence\SalesStatisticsRepository::getDataTopOrderStatistic()
             * Delete try\catch block after fix
             */
            return;
        }

        if ($methodTransferCollection === []) {
            return;
        }

        $moduleTransfers = $this->getFacade()->getModuleTransfers($methodTransferCollection, $classNodeTransfer);

        $tableTransferCollection = $this->getFacade()->getTableTransfers($moduleTransfers, $classNodeTransfer);

        foreach ($methodTransferCollection as $methodTransfer) {
            $this->applyRule($methodTransfer, $tableTransferCollection, $classNodeTransfer);
        }
    }