Neos.ContentRepository/Classes/Domain/Model/NodeData.php
public function similarize(AbstractNodeData $sourceNode, $isCopy = false)
    {
        $this->properties = [];
        foreach ($sourceNode->getProperties() as $propertyName => $propertyValue) {
            $this->setProperty($propertyName, $propertyValue);
        }

        $propertyNames = [
            'nodeType',
            'hidden',
            'hiddenAfterDateTime',
            'hiddenBeforeDateTime',
            'hiddenInIndex',
            'accessRoles'
        ];
        if (!$isCopy) {
            $propertyNames[] = 'creationDateTime';
            $propertyNames[] = 'lastModificationDateTime';
        }
        if ($sourceNode instanceof NodeData) {
            $propertyNames[] = 'index';
        }
        foreach ($propertyNames as $propertyName) {
            ObjectAccess::setProperty($this, $propertyName, ObjectAccess::getProperty($sourceNode, $propertyName));
        }

        $contentObject = $sourceNode->getContentObject();
        if ($contentObject !== null) {
            $this->setContentObject($contentObject);
        }
    }
public function similarize(AbstractNodeData $sourceNode, $isCopy = false)
    {
        $this->properties = [];
        foreach ($sourceNode->getProperties() as $propertyName => $propertyValue) {
            $this->setProperty($propertyName, $propertyValue);
        }

        $propertyNames = [
            'nodeType',
            'hidden',
            'hiddenAfterDateTime',
            'hiddenBeforeDateTime',
            'hiddenInIndex',
            'accessRoles'
        ];
        if (!$isCopy) {
            $propertyNames[] = 'creationDateTime';
            $propertyNames[] = 'lastModificationDateTime';
        }
        if ($sourceNode instanceof NodeData) {
            $propertyNames[] = 'index';
        }
        foreach ($propertyNames as $propertyName) {
            ObjectAccess::setProperty($this, $propertyName, ObjectAccess::getProperty($sourceNode, $propertyName));
        }

        $contentObject = $sourceNode->getContentObject();
        if ($contentObject !== null) {
            $this->setContentObject($contentObject);
        }
    }
public function similarize ( AbstractNodeData $ sourceNode , $ isCopy = false ) { $ this -> properties = [ ] ; foreach ( $ sourceNode -> getProperties ( ) as $ propertyName => $ propertyValue ) { $ this -> setProperty ( $ propertyName , $ propertyValue ) ; } $ propertyNames = [ 'nodeType' , 'hidden' , 'hiddenAfterDateTime' , 'hiddenBeforeDateTime' , 'hiddenInIndex' , 'accessRoles' ] ; if ( ! $ isCopy ) { $ propertyNames [ ] = 'creationDateTime' ; $ propertyNames [ ] = 'lastModificationDateTime' ; } if ( $ sourceNode instanceof NodeData ) { $ propertyNames [ ] = 'index' ; } foreach ( $ propertyNames as $ propertyName ) { ObjectAccess :: setProperty ( $ this , $ propertyName , ObjectAccess :: getProperty ( $ sourceNode , $ propertyName ) ) ; } $ contentObject = $ sourceNode -> getContentObject ( ) ; if ( $ contentObject !== null ) { $ this -> setContentObject ( $ contentObject ) ; } }
Make the node "similar" to the given source node. That means,
- all properties
- index
- node type
- content object
will be set to the same values as in the source node.

@param AbstractNodeData $sourceNode
@param boolean $isCopy
@return void
Make the node similar to the given source node . That means - all properties - index - node type - content object will be set to the same values as in the source node .