Neos.ContentRepository/Classes/Domain/Model/AbstractNodeData.php
public function setProperty($propertyName, $value)
    {
        if (!is_object($this->contentObjectProxy)) {
            switch ($this->getNodeType()->getPropertyType($propertyName)) {
                case 'references':
                    $nodeIdentifiers = [];
                    if (is_array($value)) {
                        foreach ($value as $nodeIdentifier) {
                            if ($nodeIdentifier instanceof NodeInterface || $nodeIdentifier instanceof AbstractNodeData) {
                                $nodeIdentifiers[] = $nodeIdentifier->getIdentifier();
                            } elseif (preg_match(NodeIdentifierValidator::PATTERN_MATCH_NODE_IDENTIFIER, $nodeIdentifier) !== 0) {
                                $nodeIdentifiers[] = $nodeIdentifier;
                            }
                        }
                    }
                    $value = $nodeIdentifiers;
                    break;
                case 'reference':
                    $nodeIdentifier = null;
                    if ($value instanceof NodeInterface || $value instanceof AbstractNodeData) {
                        $nodeIdentifier = $value->getIdentifier();
                    } elseif (preg_match(NodeIdentifierValidator::PATTERN_MATCH_NODE_IDENTIFIER, $value) !== 0) {
                        $nodeIdentifier = $value;
                    }
                    $value = $nodeIdentifier;
                    break;
            }

            $this->persistRelatedEntities($value);

            if (array_key_exists($propertyName, $this->properties) && $this->properties[$propertyName] === $value) {
                return;
            }

            $this->properties[$propertyName] = $value;

            $this->addOrUpdate();
        } elseif (ObjectAccess::isPropertySettable($this->contentObjectProxy->getObject(), $propertyName)) {
            $contentObject = $this->contentObjectProxy->getObject();
            ObjectAccess::setProperty($contentObject, $propertyName, $value);
            $this->updateContentObject($contentObject);
        }
    }
public function setProperty($propertyName, $value)
    {
        if (!is_object($this->contentObjectProxy)) {
            switch ($this->getNodeType()->getPropertyType($propertyName)) {
                case 'references':
                    $nodeIdentifiers = [];
                    if (is_array($value)) {
                        foreach ($value as $nodeIdentifier) {
                            if ($nodeIdentifier instanceof NodeInterface || $nodeIdentifier instanceof AbstractNodeData) {
                                $nodeIdentifiers[] = $nodeIdentifier->getIdentifier();
                            } elseif (preg_match(NodeIdentifierValidator::PATTERN_MATCH_NODE_IDENTIFIER, $nodeIdentifier) !== 0) {
                                $nodeIdentifiers[] = $nodeIdentifier;
                            }
                        }
                    }
                    $value = $nodeIdentifiers;
                    break;
                case 'reference':
                    $nodeIdentifier = null;
                    if ($value instanceof NodeInterface || $value instanceof AbstractNodeData) {
                        $nodeIdentifier = $value->getIdentifier();
                    } elseif (preg_match(NodeIdentifierValidator::PATTERN_MATCH_NODE_IDENTIFIER, $value) !== 0) {
                        $nodeIdentifier = $value;
                    }
                    $value = $nodeIdentifier;
                    break;
            }

            $this->persistRelatedEntities($value);

            if (array_key_exists($propertyName, $this->properties) && $this->properties[$propertyName] === $value) {
                return;
            }

            $this->properties[$propertyName] = $value;

            $this->addOrUpdate();
        } elseif (ObjectAccess::isPropertySettable($this->contentObjectProxy->getObject(), $propertyName)) {
            $contentObject = $this->contentObjectProxy->getObject();
            ObjectAccess::setProperty($contentObject, $propertyName, $value);
            $this->updateContentObject($contentObject);
        }
    }
public function setProperty ( $ propertyName , $ value ) { if ( ! is_object ( $ this -> contentObjectProxy ) ) { switch ( $ this -> getNodeType ( ) -> getPropertyType ( $ propertyName ) ) { case 'references' : $ nodeIdentifiers = [ ] ; if ( is_array ( $ value ) ) { foreach ( $ value as $ nodeIdentifier ) { if ( $ nodeIdentifier instanceof NodeInterface || $ nodeIdentifier instanceof AbstractNodeData ) { $ nodeIdentifiers [ ] = $ nodeIdentifier -> getIdentifier ( ) ; } elseif ( preg_match ( NodeIdentifierValidator :: PATTERN_MATCH_NODE_IDENTIFIER , $ nodeIdentifier ) !== 0 ) { $ nodeIdentifiers [ ] = $ nodeIdentifier ; } } } $ value = $ nodeIdentifiers ; break ; case 'reference' : $ nodeIdentifier = null ; if ( $ value instanceof NodeInterface || $ value instanceof AbstractNodeData ) { $ nodeIdentifier = $ value -> getIdentifier ( ) ; } elseif ( preg_match ( NodeIdentifierValidator :: PATTERN_MATCH_NODE_IDENTIFIER , $ value ) !== 0 ) { $ nodeIdentifier = $ value ; } $ value = $ nodeIdentifier ; break ; } $ this -> persistRelatedEntities ( $ value ) ; if ( array_key_exists ( $ propertyName , $ this -> properties ) && $ this -> properties [ $ propertyName ] === $ value ) { return ; } $ this -> properties [ $ propertyName ] = $ value ; $ this -> addOrUpdate ( ) ; } elseif ( ObjectAccess :: isPropertySettable ( $ this -> contentObjectProxy -> getObject ( ) , $ propertyName ) ) { $ contentObject = $ this -> contentObjectProxy -> getObject ( ) ; ObjectAccess :: setProperty ( $ contentObject , $ propertyName , $ value ) ; $ this -> updateContentObject ( $ contentObject ) ; } }
Sets the specified property.
If the node has a content object attached, the property will be set there
if it is settable.

@param string $propertyName Name of the property
@param mixed $value Value of the property
@return void
Sets the specified property . If the node has a content object attached the property will be set there if it is settable .