UserEntityClone.php in Entity Clone 8
File
src/EntityClone/Content/UserEntityClone.php
View source
<?php
namespace Drupal\entity_clone\EntityClone\Content;
use Drupal\Core\Entity\EntityInterface;
class UserEntityClone extends ContentEntityCloneBase {
public function cloneEntity(EntityInterface $entity, EntityInterface $cloned_entity, array $properties = [], array &$already_cloned = []) {
$cloned_entity
->set('name', $cloned_entity
->getAccountName() . '_cloned');
return parent::cloneEntity($entity, $cloned_entity, $properties);
}
}