function BlockInterface::createDuplicateBlock

Same name in other branches
  1. 9 core/modules/block/src/BlockInterface.php \Drupal\block\BlockInterface::createDuplicateBlock()
  2. 8.9.x core/modules/block/src/BlockInterface.php \Drupal\block\BlockInterface::createDuplicateBlock()
  3. 11.x 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

File

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

Class

BlockInterface
Provides an interface defining a block entity.

Namespace

Drupal\block

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.