Returns true if the currently authenticated user is allowed to remove the given $node

@param NodeInterface $node
@return boolean
353482
public function isGrantedToRemoveNode(NodeInterface $node)
    {
        $privilegeSubject = new NodePrivilegeSubject($node);
        return $this->privilegeManager->isGranted(RemoveNodePrivilege::class, $privilegeSubject);
    }
1009991
protected function nodeNameAvailableBelowNode(NodeInterface $parentNode, NodeInterface $node)
    {
        return $this->contentRepositoryNodeService->nodePathAvailableForNode($parentNode->getPath() . '/' . $node->getName(), $node);
    }
932550
protected function finish(NodeInterface $node)
    {
        $removeNode = new RemoveNode();
        $removeNode->setNode($node);

        $this->feedbackCollection->add($removeNode);

        // $this->getSubject() is the moved node at the NEW location!
        parent::finish($this->getSubject());
    }
805050
public function canHandle(\DOMNode $node, NodeInterface $target)
    {
        return strtolower($node->nodeName) == 'lastbuilddate' && $target instanceof FeedInterface;
    }
1213315
protected function getNodeLevelInSite(NodeInterface $node)
    {
        $siteNode = $this->currentNode->getContext()->getCurrentSiteNode();
        return $node->getDepth() - $siteNode->getDepth();
    }
711507
public function userCanEditNodeSeo(AccountInterface $account, NodeInterface $node) : bool
    {
        return
            !$this->isNodeBlacklisted($node) && (
                ($account->hasPermission(SeoService::PERM_SEO_CONTENT_OWN) && $node->access('update', $account)) ||
                ($account->hasPermission(SeoService::PERM_SEO_CONTENT_ALL) && $node->access('view', $account))
            )
        ;
    }
1150458
public function register(Node\NodeInterface $node)
	{
		if ( ! in_array($node, $this->array, true)) {
			$this->array[] = $node;
		}
	}
365205
protected function hasFacadeInterface(ClassNode $node, ASTArtifactList $implementedInterfaces)
    {
        $expectedInterfaceName = $node->getImage() . 'Interface';
        foreach ($implementedInterfaces as $implementedInterface) {
            $interfaceName = $implementedInterface->getName();
            if ($interfaceName === $expectedInterfaceName) {
                return true;
            }
        }

        return false;
    }
349753
protected function isServiceProvider(AbstractNode $node): bool
    {
        if (!($this instanceof ClassAware)) {
            return false;
        }

        $interfaceReferences = $this->getInterfaceReferences($node);

        if (!$interfaceReferences) {
            return false;
        }

        foreach ($interfaceReferences as $interfaceReference) {
            if ($interfaceReference->getType()->getName() === 'ServiceProviderInterface' || $interfaceReference->getType()->getName() === 'ControllerProviderInterface') {
                return true;
            }
        }

        return false;
    }
1269988
protected function verifyInterface(AbstractNode $node): void
    {
        $classNodeInterfaces = $node->getInterfaces();

        if (!$classNodeInterfaces->count()) {
            $message = sprintf(
                'The bridge `%s` doesn\'t  have any interfaces.',
                $node->getName()
            );
            $this->addViolation($node, [$message]);

            return;
        }

        $firstInterface = $classNodeInterfaces[0];
        $interfaceNode = new InterfaceNode($firstInterface);

        if (preg_match('#.*\\\\Dependency\\\\.*#', $interfaceNode->getNamespaceName()) !== 0) {
            return;
        }

        $message = sprintf(
            'The bridge interface is not lie in "Dependency" folder. That violates the rule "%s"',
            static::INTERFACE_RULE
        );
        $this->addViolation($interfaceNode, [$message]);
    }
719794
private function upgradeNode(NodeInterface $node)
    {
        foreach ($node->getProperties('i18n:-*') as $property) {
            $property->remove();
        }

        foreach ($node->getNodes() as $childNode) {
            $this->upgradeNode($childNode);
        }
    }
1001561
public function except(NodeInterface $node)
    {
        return $this->filter(function (NodeInterface $eachNode) use ($node) {
            return !$eachNode->is($node);
        });
    }
570990
public function removeNode(NodeInterface $node, string $targetWorkspaceName = null)
    {
        if ($this->settings['indexAllWorkspaces'] === false) {
            // we are only supposed to index the live workspace.
            // We need to check the workspace at two occasions; checking the
            // $targetWorkspaceName and the workspace name of the node's context as fallback
            if ($targetWorkspaceName !== null && $targetWorkspaceName !== 'live') {
                return;
            }

            if ($targetWorkspaceName === null && $node->getContext()->getWorkspaceName() !== 'live') {
                return;
            }
        }

        $documentIdentifier = $this->calculateDocumentIdentifier($node, $targetWorkspaceName);

        $this->currentBulkRequest[] = $this->documentDriver->delete($node, $documentIdentifier);
        $this->currentBulkRequest[] = $this->indexerDriver->fulltext($node, [], $targetWorkspaceName);

        $this->logger->log(sprintf('NodeIndexer (%s): Removed node %s (%s) from index.', $documentIdentifier, $node->getContextPath(), $node->getIdentifier()), LOG_DEBUG, null, 'ElasticSearch (CR)');
    }
427385
public function validateNode(NodeInterface $node): Asserts
    {
        return $this->validate(XmlNodeUtils::nodeToXmlString($node), $node);
    }
679506
public static function loadSessionSchedule(NodeInterface $node) {
    if (!$node) {
      return FALSE;
    }

    $schedule = [
      'nid' => $node->id(),
      'dates' => [],
      'exclusions' => [],
    ];
    $dates = $node->field_session_time->referencedEntities();
    foreach ($dates as $date) {
      if (empty($date) || empty($date->field_session_time_days->getValue()) || empty($date->field_session_time_date->getValue())) {
        continue;
      }
      $schedule_item = [
        'frequency' => 'weekly',
        'days' => [],
        'period' => [],
        'time' => [],
      ];

      foreach ($date->field_session_time_days->getValue() as $value) {
        $schedule_item['days'][] = $value['value'];
      }

      $_period = $date->field_session_time_date->getValue()[0];
      $_from = DrupalDateTime::createFromTimestamp(strtotime($_period['value'] . 'Z'));
      $_to = DrupalDateTime::createFromTimestamp(strtotime($_period['end_value'] . 'Z'));

      $schedule_item['period']['from'] = $_from->format('Y-m-d');
      $schedule_item['period']['to'] = $_to->format('Y-m-d');

      $schedule_item['time']['from'] = $_from->format('H:i:s');
      $schedule_item['time']['to'] = $_to->format('H:i:s');

      if (!isset($schedule['from']) || $schedule_item['period']['from'] < $schedule['from']) {
        $schedule['from'] = $schedule_item['period']['from'];
      }
      if (!isset($schedule['to']) || $schedule_item['period']['to'] > $schedule['to']) {
        $schedule['to'] = $schedule_item['period']['to'];
      }

      $schedule['dates'][] = $schedule_item;
    }

    $schedule['exclusions'] = $node->field_session_exclusions->getValue();
    foreach ($schedule['exclusions'] as &$exclusion) {
      $exclusion['from'] = DrupalDateTime::createFromTimestamp(strtotime($exclusion['value'] . 'Z'))->format('Y-m-d\TH:i:s');
      $exclusion['to'] = DrupalDateTime::createFromTimestamp(strtotime($exclusion['end_value'] . 'Z'))->format('Y-m-d\TH:i:s');
      unset($exclusion['value'], $exclusion['end_value']);
    }

    return $schedule;
  }
952052
public function removeNode(Node $node)
    {
        $node->setNavigation(null);
        $this->nodes->removeElement($node);
    }
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;
    }