protected function RevisionTracker::recordLatestRevision in Workbench Moderation 8
Same name and namespace in other branches
- 8.2 src/RevisionTracker.php \Drupal\workbench_moderation\RevisionTracker::recordLatestRevision()
Records the latest revision of a given entity.
Parameters
string $entity_type: The machine name of the type of entity.
string $entity_id: The Entity ID in question.
string $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".
string $revision_id: The revision ID that is now the latest revision.
Return value
int One of the valid returns from a merge query's execute method.
1 call to RevisionTracker::recordLatestRevision()
- RevisionTracker::setLatestRevision in src/
RevisionTracker.php - Sets the latest revision of a given entity.
File
- src/
RevisionTracker.php, line 73
Class
- RevisionTracker
- Tracks metadata about revisions across entities.
Namespace
Drupal\workbench_moderationCode
protected function recordLatestRevision($entity_type, $entity_id, $langcode, $revision_id) {
return $this->connection
->merge($this->tableName)
->keys([
'entity_type' => $entity_type,
'entity_id' => $entity_id,
'langcode' => $langcode,
])
->fields([
'revision_id' => $revision_id,
])
->execute();
}