ConfigEntityBase::createDuplicate

public ConfigEntityBase::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 Entity::createDuplicate

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php, line 240

Class

ConfigEntityBase
Defines a base configuration entity class.

Namespace

Drupal\Core\Config\Entity

Code

public function createDuplicate() {
  $duplicate = parent::createDuplicate();

  // Prevent the new duplicate from being misinterpreted as a rename.
  $duplicate->setOriginalId(NULL);
  return $duplicate;
}
doc_Drupal
2016-10-29 08:52:26
Comments
Leave a Comment

Please login to continue.