Neos.Neos/Classes/Service/PublishingService.php
public function discardNode(NodeInterface $node)
    {
        $nodes = [$node];
        $nodeType = $node->getNodeType();

        if ($nodeType->isOfType('Neos.Neos:Document') || $nodeType->hasConfiguration('childNodes')) {
            $nodes = array_filter(
                array_merge($nodes, $this->collectAllContentChildNodes($node)),
                function ($possiblyPublishableNode) use ($node) {
                    return $possiblyPublishableNode->getWorkspace()->getName() === $node->getWorkspace()->getName();
                }
            );
        }

        $this->discardNodes($nodes);
    }
public function discardNode(NodeInterface $node)
    {
        $nodes = [$node];
        $nodeType = $node->getNodeType();

        if ($nodeType->isOfType('Neos.Neos:Document') || $nodeType->hasConfiguration('childNodes')) {
            $nodes = array_filter(
                array_merge($nodes, $this->collectAllContentChildNodes($node)),
                function ($possiblyPublishableNode) use ($node) {
                    return $possiblyPublishableNode->getWorkspace()->getName() === $node->getWorkspace()->getName();
                }
            );
        }

        $this->discardNodes($nodes);
    }
public function discardNode ( NodeInterface $ node ) { $ nodes = [ $ node ] ; $ nodeType = $ node -> getNodeType ( ) ; if ( $ nodeType -> isOfType ( 'Neos.Neos:Document' ) || $ nodeType -> hasConfiguration ( 'childNodes' ) ) { $ nodes = array_filter ( array_merge ( $ nodes , $ this -> collectAllContentChildNodes ( $ node ) ) , function ( $ possiblyPublishableNode ) use ( $ node ) { return $ possiblyPublishableNode -> getWorkspace ( ) -> getName ( ) === $ node -> getWorkspace ( ) -> getName ( ) ; } ) ; } $ this -> discardNodes ( $ nodes ) ; }
Discards the given node from its workspace.

If the given node is a Document or has ContentCollection child nodes, these nodes are discarded as well.

@param NodeInterface $node
Discards the given node from its workspace .