You are here

public function EntityCloneInterface::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.

2 methods override EntityCloneInterface::cloneEntity()
ConfigEntityCloneBase::cloneEntity in src/EntityClone/Config/ConfigEntityCloneBase.php
Clone an entity.
ContentEntityCloneBase::cloneEntity in src/EntityClone/Content/ContentEntityCloneBase.php
Clone an entity.

File

src/EntityClone/EntityCloneInterface.php, line 25

Class

EntityCloneInterface
Defines a common interface for all entity clone objects.

Namespace

Drupal\entity_clone\EntityClone

Code

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