You are here

protected function BulkEditFormTrait::getNewRevisionDefault in Views Bulk Edit 8.2

Should new revisions be created by default?

Return value

bool As in the title.

See also

\Drupal\Core\Entity\ContentEntityForm::getNewRevisionDefault()

1 call to BulkEditFormTrait::getNewRevisionDefault()
BulkEditFormTrait::getRevisionForm in src/Form/BulkEditFormTrait.php
Builds the revision form.

File

src/Form/BulkEditFormTrait.php, line 195

Class

BulkEditFormTrait
Common methods for Views Bulk Edit forms.

Namespace

Drupal\views_bulk_edit\Form

Code

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

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