/** * @param Model\Document $document * @return Model\Document */ protected function getLatestVersion(Model\Document $document) { $latestVersion = $document->getLatestVersion(); if ($latestVersion) { $latestDoc = $latestVersion->loadData(); if ($latestDoc instanceof Model\Document) { $latestDoc->setModificationDate($document->getModificationDate()); // set de modification-date from published version to compare it in js-frontend return $latestDoc; } } return $document; }