You are here

public function BlockContent::createDuplicate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block_content/src/Entity/BlockContent.php \Drupal\block_content\Entity\BlockContent::createDuplicate()

Creates a duplicate of the entity.

Return value

static A clone of $this with all identifiers unset, so saving it inserts a new entity into the storage system.

Overrides ContentEntityBase::createDuplicate

File

core/modules/block_content/src/Entity/BlockContent.php, line 85
Contains \Drupal\block_content\Entity\BlockContent.

Class

BlockContent
Defines the custom block entity class.

Namespace

Drupal\block_content\Entity

Code

public function createDuplicate() {
  $duplicate = parent::createDuplicate();
  $duplicate->revision_id->value = NULL;
  $duplicate->id->value = NULL;
  return $duplicate;
}