protected function updateLastModified(Node $node)
{
if (!$this->getAutoLastModified() || !$node->isNodeType('mix:lastModified')) {
return;
}
if ($node->hasProperty('jcr:lastModified') && !$node->getProperty('jcr:lastModified')->isModified() && !$node->getProperty('jcr:lastModified')->isNew()) {
$node->setProperty('jcr:lastModified', new \DateTime());
}
if ($node->hasProperty('jcr:lastModifiedBy') && !$node->getProperty('jcr:lastModifiedBy')->isModified() && !$node->getProperty('jcr:lastModifiedBy')->isNew()) {
$node->setProperty('jcr:lastModifiedBy', $this->credentials->getUserID());
}
}