You are here

public function MenuEntityClone::cloneEntity in Entity Clone 8

Clone an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity.

\Drupal\Core\Entity\EntityInterface $cloned_entity: The cloned entity.

array $properties: All new properties to replace old.

Return value

\Drupal\Core\Entity\EntityInterface The new saved entity.

Overrides ConfigEntityCloneBase::cloneEntity

File

src/EntityClone/Config/MenuEntityClone.php, line 15

Class

MenuEntityClone
Class MenuEntityClone.

Namespace

Drupal\entity_clone\EntityClone\Config

Code

public function cloneEntity(EntityInterface $entity, EntityInterface $cloned_entity, array $properties = []) {

  /** @var \Drupal\system\Entity\Menu */
  $cloned_entity
    ->set('locked', FALSE);
  return parent::cloneEntity($entity, $cloned_entity, $properties);
}