You are here

public function RevisionableStorageInterface::createRevision in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/RevisionableStorageInterface.php \Drupal\Core\Entity\RevisionableStorageInterface::createRevision()

Creates a new revision starting off from the specified entity object.

Parameters

\Drupal\Core\Entity\RevisionableInterface $entity: The revisionable entity object being modified.

bool $default: (optional) Whether the new revision should be marked as default. Defaults to TRUE.

Return value

\Drupal\Core\Entity\RevisionableInterface A new entity revision object.

1 method overrides RevisionableStorageInterface::createRevision()
TranslatableRevisionableStorageInterface::createRevision in core/lib/Drupal/Core/Entity/TranslatableRevisionableStorageInterface.php
Creates a new revision starting off from the specified entity object.

File

core/lib/Drupal/Core/Entity/RevisionableStorageInterface.php, line 22

Class

RevisionableStorageInterface
A storage that supports revisionable entity types.

Namespace

Drupal\Core\Entity

Code

public function createRevision(RevisionableInterface $entity, $default = TRUE);