You are here

class UserEntityClone in Entity Clone 8

Class ContentEntityCloneBase.

Hierarchy

Expanded class hierarchy of UserEntityClone

1 file declares its use of UserEntityClone
entity_clone.module in ./entity_clone.module
Contains entity_clone.module.

File

src/EntityClone/Content/UserEntityClone.php, line 10

Namespace

Drupal\entity_clone\EntityClone\Content
View source
class UserEntityClone extends ContentEntityCloneBase {

  /**
   * {@inheritdoc}
   */
  public function cloneEntity(EntityInterface $entity, EntityInterface $cloned_entity, array $properties = [], array &$already_cloned = []) {

    /** @var \Drupal\user\UserInterface $cloned_entity */
    $cloned_entity
      ->set('name', $cloned_entity
      ->getAccountName() . '_cloned');
    return parent::cloneEntity($entity, $cloned_entity, $properties);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContentEntityCloneBase::$currentUser protected property The current user.
ContentEntityCloneBase::$entityTypeId protected property The entity type ID.
ContentEntityCloneBase::$entityTypeManager protected property The entity type manager.
ContentEntityCloneBase::$timeService protected property A service for obtaining the system's time.
ContentEntityCloneBase::cloneReferencedEntities protected function Clones referenced entities.
ContentEntityCloneBase::createInstance public static function Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface::createInstance
ContentEntityCloneBase::fieldIsClonable protected function Determines if a field is clonable.
ContentEntityCloneBase::getChildProperties protected function Fetches the properties of a child entity.
ContentEntityCloneBase::setClonedEntityLabel protected function Sets the cloned entity's label.
ContentEntityCloneBase::__construct public function Constructs a new ContentEntityCloneBase.
UserEntityClone::cloneEntity public function Clone an entity. Overrides ContentEntityCloneBase::cloneEntity