Sets the timestamps from the node to the document.

@param HydrateEvent $event
779487
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
            )
        );
    }
327127
public function setUpdatedAt($time)
    {
        if ($time instanceof \DateTimeInterface) {
            $time = $time->format(DATE_RFC3339);
        }

        $this->setValue('lastModified', (string) $time);
    }
1011092
final private function replayChange(Event $event)
    {
        $this->apply($event->payload());
        $this->lastCommittedEventSequenceNumber = $event->sequenceNumber();
    }
205640
public function setSendTimestamp(\AgentSIB\Diadoc\Api\Proto\Timestamp $value = null)
    {
        $this->SendTimestamp = $value;
    }
842228
public function onPostHydrate(HydrationEvent $event)
    {
        $entity = $event->getSubject();
        if (!$entity instanceof Entity\Users) {
            return;
        }

        // Ensure Permissions::ROLE_EVERYONE always exists
        $roles = $entity->getRoles();
        if (!in_array(Permissions::ROLE_EVERYONE, $roles)) {
            $roles[] = Permissions::ROLE_EVERYONE;
            $entity->setRoles($roles);
        }
    }
700199
public function handleDocumentFromRegistry(HydrateEvent $event)
    {
        if ($event->hasDocument()) {
            return;
        }

        $node = $event->getNode();
        if (!$this->documentRegistry->hasNode($node, $event->getLocale())) {
            return;
        }

        $document = $this->documentRegistry->getDocumentForNode($node, $event->getLocale());

        $event->setDocument($document);

        $options = $event->getOptions();

        // if reydration is not required (f.e. we just want to retrieve the
        // current state of the document, no matter it's current state) stop
        // further event propagation - we have the document now.
        if (isset($options['rehydrate']) && false === $options['rehydrate']) {
            $event->stopPropagation();
        }
    }
1101185
public function refreshDocumentForDeleteDraft(RemoveDraftEvent $event)
    {
        $this->rehydrateDocument($event->getDocument(), $event->getNode(), $event->getLocale());
    }
142916
public function addTimeEvent(TimeEvent $event)
    {
        if (!$this->timeEvents) {
            $this->timeEvents = [];
        }
        $this->timeEvents[] = $event;
    }
607406
public function setFromTimestamp(\AgentSIB\Diadoc\Api\Proto\Timestamp $value = null)
    {
        $this->FromTimestamp = $value;
    }
966972
public function setLastEventTimestamp(\AgentSIB\Diadoc\Api\Proto\Timestamp $value = null)
    {
        $this->LastEventTimestamp = $value;
    }
1144327
public void assignTimestamp(XEvent event, long time) {
		XAttributeTimestamp attr = (XAttributeTimestamp) ATTR_TIMESTAMP.clone();
		attr.setValueMillis(time);
		event.getAttributes().put(KEY_TIMESTAMP, attr);
	}
675761
public function handleNodeFromRegistry($event)
    {
        if ($event->hasNode()) {
            return;
        }

        $document = $event->getDocument();

        if (!$this->documentRegistry->hasDocument($document)) {
            return;
        }

        $node = $this->documentRegistry->getNodeForDocument($document);
        $event->setNode($node);
    }
1027189
public function handleHydrate(HydrateEvent $event)
    {
        $document = $event->getDocument();
        $node = $event->getNode();
        $propertyName = $this->propertyEncoder->systemName(static::FIELD);
        if (!$document instanceof PageBehavior || !$node->hasProperty($propertyName)) {
            return;
        }

        $node = $event->getNode();
        $document->setPageNumber($node->getPropertyValue($this->propertyEncoder->systemName(static::FIELD)));
    }
1186380
public function handleSetParentNode(PersistEvent $event)
    {
        if (!$event->getDocument() instanceof DateShardingBehavior || $event->hasParentNode()) {
            return;
        }

        $date = $event->getDocument()->getCreated();
        if (null === $date) {
            $date = new \DateTime();
        }

        $path = $this->pathBuilder->build(['%base%', '%articles%', $date->format('Y'), $date->format('m')]);

        $event->setParentNode($this->nodeManager->createPath($path));
    }
1024580
public function onUpdateRunLabelEvents(NodeEvent $event)
    {
        $node = $event->getNode();

        if ($oldLabels = field_get_items('node', $node->original, 'labels')) {
            $oldLabels = array_column($oldLabels, 'tid');
        } else {
            $oldLabels = [];
        }

        if ($currentLabels = field_get_items('node', $node, 'labels')) {
            if (is_array($currentLabels)) {
                $currentLabels = array_column($currentLabels, 'tid');
            }
            else {
                $currentLabels = (array) $currentLabels;
            }
        }

        if ($currentLabels && ($newLabels = array_diff($currentLabels, $oldLabels))) {
            $newEvent = new ResourceEvent('node', $node->nid, $this->currentUser->id());
            $newEvent->setArgument('new_labels', $newLabels);
            $this->dispatcher->dispatch('node:new_labels', $newEvent);
        }
    }
1149237
public function handlePreRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        $event = $this->getDeleteEvent($document);
        $this->deleteEvents[spl_object_hash($document)] = $event;
        $this->eventDispatcher->dispatch(
            ContentEvents::NODE_PRE_DELETE,
            $event
        );
    }
884529
public function invalidateNodeTag(NodeEvent $event)
    {
        $node = $event->getNode();

        $this->cacheableManager->invalidateTags(
            array(
                $this->tagManager->formatNodeIdTag($node->getNodeId())
            )
        );
    }