trait RevisionLogEntityTrait (View source)

Provides a trait for accessing revision logging and ownership information.

Methods

revisionLogBaseFieldDefinitions(EntityTypeInterface $entity_type)

Provides revision-related base field definitions for an entity type.

getRevisionCreationTime()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionCreationTime().

setRevisionCreationTime($timestamp)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionCreationTime().

getRevisionUser()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser().

setRevisionUser(UserInterface $account)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUser().

getRevisionUserId()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUserId().

setRevisionUserId($user_id)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId().

getRevisionLogMessage()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionLogMessage().

setRevisionLogMessage($revision_log_message)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionLogMessage().

static string
getRevisionMetadataKey(EntityTypeInterface $entity_type, string $key)

Gets the name of a revision metadata field.

Details

static FieldDefinitionInterface[] revisionLogBaseFieldDefinitions(EntityTypeInterface $entity_type)

Provides revision-related base field definitions for an entity type.

Parameters

EntityTypeInterface $entity_type

The entity type definition.

Return Value

FieldDefinitionInterface[]

An array of base field definitions for the entity type, keyed by field name.

See also

FieldableEntityInterface::baseFieldDefinitions

getRevisionCreationTime()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionCreationTime().

setRevisionCreationTime($timestamp)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionCreationTime().

Parameters

$timestamp

getRevisionUser()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser().

setRevisionUser(UserInterface $account)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUser().

Parameters

UserInterface $account

getRevisionUserId()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUserId().

setRevisionUserId($user_id)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId().

Parameters

$user_id

getRevisionLogMessage()

Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionLogMessage().

setRevisionLogMessage($revision_log_message)

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionLogMessage().

Parameters

$revision_log_message

static protected string getRevisionMetadataKey(EntityTypeInterface $entity_type, string $key)

Gets the name of a revision metadata field.

Parameters

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.