You are here

protected static function RevisionLogEntityTrait::getRevisionMetadataKey in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php \Drupal\Core\Entity\RevisionLogEntityTrait::getRevisionMetadataKey()

Gets the name of a revision metadata field.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: A content entity type definition.

string $key: The revision metadata key to get, must be one of 'revision_created', 'revision_user' or 'revision_log_message'.

Return value

string The name of the field for the specified $key.

File

core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php, line 138

Class

RevisionLogEntityTrait
Provides a trait for accessing revision logging and ownership information.

Namespace

Drupal\Core\Entity

Code

protected static function getRevisionMetadataKey(EntityTypeInterface $entity_type, $key) {
  @trigger_error(static::class . 'getRevisionMetadataKey() is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use $entity_type->getRevisionMetadataKey() instead. See: https://www.drupal.org/node/2831499', E_USER_DEPRECATED);

  /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
  return $entity_type
    ->getRevisionMetadataKey($key);
}