function ContentEntityType::getRevisionMetadataKeys
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType::getRevisionMetadataKeys()
- 10 core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType::getRevisionMetadataKeys()
- 11.x core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType::getRevisionMetadataKeys()
Overrides ContentEntityTypeInterface::getRevisionMetadataKeys
2 calls to ContentEntityType::getRevisionMetadataKeys()
- ContentEntityType::getRevisionMetadataKey in core/
lib/ Drupal/ Core/ Entity/ ContentEntityType.php - Gets a specific entity revision metadata key.
- ContentEntityType::hasRevisionMetadataKey in core/
lib/ Drupal/ Core/ Entity/ ContentEntityType.php - Indicates if a given entity revision metadata key exists.
File
-
core/
lib/ Drupal/ Core/ Entity/ ContentEntityType.php, line 80
Class
- ContentEntityType
- Provides an implementation of a content entity type and its metadata.
Namespace
Drupal\Core\EntityCode
public function getRevisionMetadataKeys($include_backwards_compatibility_field_names = TRUE) {
// Provide backwards compatibility in case the revision metadata keys are
// not defined in the entity annotation.
if ((!$this->revision_metadata_keys || $this->revision_metadata_keys == $this->requiredRevisionMetadataKeys) && $include_backwards_compatibility_field_names) {
$base_fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions($this->id());
if (isset($base_fields['revision_uid']) && ($revision_user = 'revision_uid') || isset($base_fields['revision_user']) && ($revision_user = 'revision_user')) {
@trigger_error('The revision_user revision metadata key is not set for entity type: ' . $this->id . ' See: https://www.drupal.org/node/2831499', E_USER_DEPRECATED);
$this->revision_metadata_keys['revision_user'] = $revision_user;
}
if (isset($base_fields['revision_timestamp']) && ($revision_timestamp = 'revision_timestamp') || isset($base_fields['revision_created']) && ($revision_timestamp = 'revision_created')) {
@trigger_error('The revision_created revision metadata key is not set for entity type: ' . $this->id . ' See: https://www.drupal.org/node/2831499', E_USER_DEPRECATED);
$this->revision_metadata_keys['revision_created'] = $revision_timestamp;
}
if (isset($base_fields['revision_log']) && ($revision_log = 'revision_log') || isset($base_fields['revision_log_message']) && ($revision_log = 'revision_log_message')) {
@trigger_error('The revision_log_message revision metadata key is not set for entity type: ' . $this->id . ' See: https://www.drupal.org/node/2831499', E_USER_DEPRECATED);
$this->revision_metadata_keys['revision_log_message'] = $revision_log;
}
}
return $this->revision_metadata_keys;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.