Neos\ContentRepository\Domain\Model\Node::setRemoved PHP Method

setRemoved() public method

Enables using the remove method when only setters are available
public setRemoved ( boolean $removed ) : void
$removed boolean If TRUE, this node and it's child nodes will be removed. If it is FALSE only this node will be restored.
return void
    public function setRemoved($removed)
    {
        if (!$this->isNodeDataMatchingContext()) {
            $this->materializeNodeData();
        }
        if ((bool) $removed === true) {
            /** @var $childNode Node */
            foreach ($this->getChildNodes() as $childNode) {
                $childNode->setRemoved(true);
            }
            $this->nodeData->setRemoved(true);
            $this->emitNodeRemoved($this);
        } else {
            $this->nodeData->setRemoved(false);
            $this->emitNodeUpdated($this);
        }
        $this->context->getFirstLevelNodeCache()->flush();
    }
Node