Neos.ContentRepository/Classes/Domain/Service/NodeService.php
public function cleanUpAutoCreatedChildNodes(NodeInterface $node, NodeType $oldNodeType)
    {
        $newNodeType = $node->getNodeType();
        $autoCreatedChildNodesForNewNodeType = $newNodeType->getAutoCreatedChildNodes();
        $autoCreatedChildNodesForOldNodeType = $oldNodeType->getAutoCreatedChildNodes();
        $removedChildNodesFromOldNodeType = array_diff(
            array_keys($autoCreatedChildNodesForOldNodeType),
            array_keys($autoCreatedChildNodesForNewNodeType)
        );
        /** @var NodeInterface $childNode */
        foreach ($node->getChildNodes() as $childNode) {
            if (in_array($childNode->getName(), $removedChildNodesFromOldNodeType)) {
                $childNode->remove();
            }
        }
    }
public function cleanUpAutoCreatedChildNodes(NodeInterface $node, NodeType $oldNodeType)
    {
        $newNodeType = $node->getNodeType();
        $autoCreatedChildNodesForNewNodeType = $newNodeType->getAutoCreatedChildNodes();
        $autoCreatedChildNodesForOldNodeType = $oldNodeType->getAutoCreatedChildNodes();
        $removedChildNodesFromOldNodeType = array_diff(
            array_keys($autoCreatedChildNodesForOldNodeType),
            array_keys($autoCreatedChildNodesForNewNodeType)
        );
        /** @var NodeInterface $childNode */
        foreach ($node->getChildNodes() as $childNode) {
            if (in_array($childNode->getName(), $removedChildNodesFromOldNodeType)) {
                $childNode->remove();
            }
        }
    }
public function cleanUpAutoCreatedChildNodes ( NodeInterface $ node , NodeType $ oldNodeType ) { $ newNodeType = $ node -> getNodeType ( ) ; $ autoCreatedChildNodesForNewNodeType = $ newNodeType -> getAutoCreatedChildNodes ( ) ; $ autoCreatedChildNodesForOldNodeType = $ oldNodeType -> getAutoCreatedChildNodes ( ) ; $ removedChildNodesFromOldNodeType = array_diff ( array_keys ( $ autoCreatedChildNodesForOldNodeType ) , array_keys ( $ autoCreatedChildNodesForNewNodeType ) ) ; /** @var NodeInterface $childNode */ foreach ( $ node -> getChildNodes ( ) as $ childNode ) { if ( in_array ( $ childNode -> getName ( ) , $ removedChildNodesFromOldNodeType ) ) { $ childNode -> remove ( ) ; } } }
Removes all auto created child nodes that existed in the previous nodeType.

@param NodeInterface $node
@param NodeType $oldNodeType
@return void
Removes all auto created child nodes that existed in the previous nodeType .