src/Sulu/Component/DocumentManager/Subscriber/Behavior/Audit/TimestampSubscriber.php
public function setTimestampsOnDocument(HydrateEvent $event)
    {
        $document = $event->getDocument();
        if (!$this->supports($document)) {
            return;
        }

        $accessor = $event->getAccessor();
        $node = $event->getNode();
        $locale = $this->documentInspector->getOriginalLocale($document);

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

        $accessor->set(
            static::CHANGED,
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->encode($encoding, static::CHANGED, $locale),
                null
            )
        );
        $accessor->set(
            static::CREATED,
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->encode($encoding, static::CREATED, $locale),
                null
            )
        );
    }
public function setTimestampsOnDocument(HydrateEvent $event)
    {
        $document = $event->getDocument();
        if (!$this->supports($document)) {
            return;
        }

        $accessor = $event->getAccessor();
        $node = $event->getNode();
        $locale = $this->documentInspector->getOriginalLocale($document);

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

        $accessor->set(
            static::CHANGED,
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->encode($encoding, static::CHANGED, $locale),
                null
            )
        );
        $accessor->set(
            static::CREATED,
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->encode($encoding, static::CREATED, $locale),
                null
            )
        );
    }
public function setTimestampsOnDocument ( HydrateEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ this -> supports ( $ document ) ) { return ; } $ accessor = $ event -> getAccessor ( ) ; $ node = $ event -> getNode ( ) ; $ locale = $ this -> documentInspector -> getOriginalLocale ( $ document ) ; $ encoding = $ this -> getPropertyEncoding ( $ document ) ; $ accessor -> set ( static :: CHANGED , $ node -> getPropertyValueWithDefault ( $ this -> propertyEncoder -> encode ( $ encoding , static :: CHANGED , $ locale ) , null ) ) ; $ accessor -> set ( static :: CREATED , $ node -> getPropertyValueWithDefault ( $ this -> propertyEncoder -> encode ( $ encoding , static :: CREATED , $ locale ) , null ) ) ; }
Sets the timestamps from the node to the document.

@param HydrateEvent $event
Sets the timestamps from the node to the document .