public function ModerationInformation::getDefaultRevisionId in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::getDefaultRevisionId()
- 9 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::getDefaultRevisionId()
File
- core/
modules/ content_moderation/ src/ ModerationInformation.php, line 90
Class
- ModerationInformation
- General service for moderation-related questions about Entity API.
Namespace
Drupal\content_moderationCode
public function getDefaultRevisionId($entity_type_id, $entity_id) {
if ($storage = $this->entityTypeManager
->getStorage($entity_type_id)) {
$result = $storage
->getQuery()
->currentRevision()
->condition($this->entityTypeManager
->getDefinition($entity_type_id)
->getKey('id'), $entity_id)
->accessCheck(FALSE)
->execute();
if ($result) {
return key($result);
}
}
}