You are here

protected function ContentEntityForm::getNewRevisionDefault in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::getNewRevisionDefault()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::getNewRevisionDefault()

Should new revisions created on default.

Return value

bool New revision on default.

1 call to ContentEntityForm::getNewRevisionDefault()
ContentEntityForm::addRevisionableFormFields in core/lib/Drupal/Core/Entity/ContentEntityForm.php
Add revision form fields if the entity enabled the UI.

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 466

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

protected function getNewRevisionDefault() {
  $new_revision_default = FALSE;
  $bundle_entity = $this
    ->getBundleEntity();
  if ($bundle_entity instanceof RevisionableEntityBundleInterface) {

    // Always use the default revision setting.
    $new_revision_default = $bundle_entity
      ->shouldCreateNewRevision();
  }
  return $new_revision_default;
}