src/Sulu/Component/Content/Document/Subscriber/BlameSubscriber.php
public function setBlamesOnNode(
        LocalizedBlameBehavior $document,
        NodeInterface $node,
        $locale,
        DocumentAccessor $accessor,
        $userId
    ) {
        if (!$document instanceof BlameBehavior && !$locale) {
            return;
        }

        $encoding = $this->getPropertyEncoding($document);

        $creatorPropertyName = $this->propertyEncoder->encode($encoding, static::CREATOR, $locale);
        if (!$node->hasProperty($creatorPropertyName)) {
            $accessor->set(self::CREATOR, $userId);
            $node->setProperty(
                $creatorPropertyName,
                $document->getCreator()
            );
        }

        $accessor->set(self::CHANGER, $userId);
        $node->setProperty(
            $this->propertyEncoder->encode($encoding, static::CHANGER, $locale),
            $userId
        );
    }
public function setBlamesOnNode(
        LocalizedBlameBehavior $document,
        NodeInterface $node,
        $locale,
        DocumentAccessor $accessor,
        $userId
    ) {
        if (!$document instanceof BlameBehavior && !$locale) {
            return;
        }

        $encoding = $this->getPropertyEncoding($document);

        $creatorPropertyName = $this->propertyEncoder->encode($encoding, static::CREATOR, $locale);
        if (!$node->hasProperty($creatorPropertyName)) {
            $accessor->set(self::CREATOR, $userId);
            $node->setProperty(
                $creatorPropertyName,
                $document->getCreator()
            );
        }

        $accessor->set(self::CHANGER, $userId);
        $node->setProperty(
            $this->propertyEncoder->encode($encoding, static::CHANGER, $locale),
            $userId
        );
    }
public function setBlamesOnNode ( LocalizedBlameBehavior $ document , NodeInterface $ node , $ locale , DocumentAccessor $ accessor , $ userId ) { if ( ! $ document instanceof BlameBehavior && ! $ locale ) { return ; } $ encoding = $ this -> getPropertyEncoding ( $ document ) ; $ creatorPropertyName = $ this -> propertyEncoder -> encode ( $ encoding , static :: CREATOR , $ locale ) ; if ( ! $ node -> hasProperty ( $ creatorPropertyName ) ) { $ accessor -> set ( self :: CREATOR , $ userId ) ; $ node -> setProperty ( $ creatorPropertyName , $ document -> getCreator ( ) ) ; } $ accessor -> set ( self :: CHANGER , $ userId ) ; $ node -> setProperty ( $ this -> propertyEncoder -> encode ( $ encoding , static :: CHANGER , $ locale ) , $ userId ) ; }
Persists the data of creator and changer to the Node.

@param LocalizedBlameBehavior $document
@param NodeInterface $node
@param string $locale string
@param DocumentAccessor $accessor
@param int $userId
Persists the data of creator and changer to the Node .