function ContentEntityType::setRevisionMetadataKey

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType::setRevisionMetadataKey()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType::setRevisionMetadataKey()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType::setRevisionMetadataKey()

Overrides ContentEntityTypeInterface::setRevisionMetadataKey

File

core/lib/Drupal/Core/Entity/ContentEntityType.php, line 82

Class

ContentEntityType
Provides an implementation of a content entity type and its metadata.

Namespace

Drupal\Core\Entity

Code

public function setRevisionMetadataKey($key, $field_name) {
    if ($field_name !== NULL) {
        $this->revision_metadata_keys[$key] = $field_name;
    }
    else {
        unset($this->revision_metadata_keys[$key]);
    }
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.