You are here

public function BlockInterface::createDuplicateBlock in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/block/src/BlockInterface.php \Drupal\block\BlockInterface::createDuplicateBlock()

Creates a duplicate of the block entity.

Parameters

string $new_id: (optional) The new ID on the duplicate block.

string $new_theme: (optional) The theme on the duplicate block.

Return value

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

1 method overrides BlockInterface::createDuplicateBlock()
Block::createDuplicateBlock in core/modules/block/src/Entity/Block.php
Creates a duplicate of the block entity.

File

core/modules/block/src/BlockInterface.php, line 141

Class

BlockInterface
Provides an interface defining a block entity.

Namespace

Drupal\block

Code

public function createDuplicateBlock($new_id = NULL, $new_theme = NULL);