public function RevisionTracker::setLatestRevision in Workbench Moderation 8.2
Same name and namespace in other branches
- 8 src/RevisionTracker.php \Drupal\workbench_moderation\RevisionTracker::setLatestRevision()
Sets the latest revision of a given entity.
Parameters
$entity_type: The machine name of the type of entity.
$entity_id: The Entity ID in question.
$langcode: The langcode of the revision we're saving. Each language has its own effective tree of entity revisions, so in different languages different revisions will be "latest".
$revision_id: The revision ID that is now the latest revision.
Return value
static
Overrides RevisionTrackerInterface::setLatestRevision
File
- src/
RevisionTracker.php, line 46
Class
- RevisionTracker
- Tracks metadata about revisions across entities.
Namespace
Drupal\workbench_moderationCode
public function setLatestRevision($entity_type, $entity_id, $langcode, $revision_id) {
try {
$this
->recordLatestRevision($entity_type, $entity_id, $langcode, $revision_id);
} catch (DatabaseExceptionWrapper $e) {
$this
->ensureTableExists();
$this
->recordLatestRevision($entity_type, $entity_id, $langcode, $revision_id);
}
return $this;
}