(non-PHPdoc).

@see AnDomainEntityAbstract::cloneEntity()
551605
public function cloneEntity($deep = true)
    {
        $clone = parent::cloneEntity($deep);

        $clone->setSubscriber($this->_subscriber);
        $clone->setPackage($this->_package);
        $clone->setPaymentMethod($this->_payment_method);

        return $clone;
    }
1235255
public function onCopy(CopyResourceEvent $event)
    {
        $em = $this->container->get('doctrine.orm.entity_manager');
        $resource = $event->getResource();
        $revisions = $resource->getRevisions();
        $copy = new Text();
        $copy->setVersion($resource->getVersion());

        foreach ($revisions as $revision) {
            $rev = new Revision();
            $rev->setVersion($revision->getVersion());
            $rev->setContent($revision->getContent());
            $rev->setUser($revision->getUser());
            $rev->setText($copy);
            $em->persist($rev);
        }

        $event->setCopy($copy);
    }
1055971
public EntityMakerBuilder reuseEntity(Serializable entity) {
        Class aClass = entity.getClass();
        valueHolder.putIfNotNull(aClass, entity);
        return this;
    }
58148
function copy( $collectionItemID )
    {
        $item = clone $this;
        $item->setAttribute( 'item_id', $collectionItemID );
        $item->store();
        return $item;
    }
564859
function deep_copy() {
    $frame = new Frame($this->get_node()->cloneNode());
    $frame->set_style(clone $this->_frame->get_original_style());
    $deco = Frame_Factory::decorate_frame($frame, $this->_dompdf);
    $deco->set_root($this->_root);

    foreach ($this->get_children() as $child)
      $deco->append_child($child->deep_copy());

    return $deco;
  }
58185
public function getNewFormRequestMeta($clone = TRUE) {
    if (!isset($this->newFormRequestMeta)) {
      $this->newFormRequestMeta = new RequestMeta(\Psc\Net\HTTP\Request::GET,
                                               $this->constructUrl(array($this->getEntityNamePlural(), 'form'))
                                              );
    }
    
    if ($clone) {
      return clone $this->newFormRequestMeta;
    } else {
      return $this->newFormRequestMeta;
    }
  }
883947
def clone(self):
        """"""
        clone_copy = copy.deepcopy(self)
        clone_copy.state_ = EntityState()

        return clone_copy
775042
public function copy($type = null)
    {
        $builder = new Builder($this->type, $this->dogmatist, $this->parent, $this->strict);
        $this->copyData($builder);

        if ($type !== null) {
            $builder->setType($type);
        }

        return $builder;
    }
769353
public function CloneInstance()
	{
		$result = new AttributeNodeIterator();
		$result->AssignFrom( $this );
		$result->ignoreIdAttributes = $this->ignoreIdAttributes;
		return $result;
	}
532413
public function deepCloneAndSave($entity)
    {
        $clonedEntity = clone $entity;
        $this->eventDispatcher->dispatch(Events::DEEP_CLONE_AND_SAVE, new DeepCloneAndSaveEvent($entity, $clonedEntity, $this->em));

        $this->em->persist($clonedEntity);
        $this->em->flush();

        $this->eventDispatcher->dispatch(Events::POST_DEEP_CLONE_AND_SAVE, new DeepCloneAndSaveEvent($entity, $clonedEntity, $this->em));

        return $clonedEntity;
    }
810693
function cloneImage( $imageObject, $width, $height, $useTruecolor = null )
    {
        if ( $this->ImageObject !== null and
             $this->ImageObjectRef !== null )
        {
            $this->destroy();
        }
        $this->ImageObject = eZImageInterface::createImage( $width, $height, $useTruecolor );
        $this->IsTrueColor = $useTruecolor;
        $this->ImageObjectRef = eZImageInterface::registerImage( $this->ImageObject );
        ImageCopy( $this->ImageObject, $imageObject, 0, 0, 0, 0, $width, $height );
    }
1206304
public function copy($entityId)
    {
        $this->preCopy($entityId);
        $entity = $this->doCopy($entityId);
        $entity = $this->postCopy($entity);
        $this->getEntityManager()->flush($entity);

        return $entity;
    }
411451
protected function duplicateAttachments($clone) {
		if (!$this->attachment || !method_exists($clone, 'getCloneableFileAttributes')) return;
		foreach($clone->getCloneableFileAttributes() as $attribute) {
			if (!$original = $clone->getAttribute($attribute)) continue;
			$clone->setAttribute($attribute, $this->attachment->duplicate($original));
		}
	}
788843
public static void serializeCopyEntity(State state, CopyEntity copyEntity) {
    state.setProp(SERIALIZED_COPYABLE_FILE, CopyEntity.serialize(copyEntity));
    state.setProp(COPY_ENTITY_CLASS, copyEntity.getClass().getName());
  }
139928
private function cloneQuery(Query $query)
    {
        /* @var $cloneQuery Query */
        $cloneQuery = clone $query;
        $cloneQuery->setParameters($query->getParameters());
        foreach ($query->getHints() as $name => $value) {
            $cloneQuery->setHint($name, $value);
        }

        return $cloneQuery;
    }
1003075
public function clone(Context $context, string $entity, string $id): JsonResponse
    {
        $entity = $this->urlToSnakeCase($entity);

        $definition = $this->definitionRegistry->getByEntityName($entity);

        $eventContainer = $this->definitionRegistry->getRepository($definition->getEntityName())->clone($id, $context);
        $event = $eventContainer->getEventByDefinition($definition->getClass());
        if (!$event) {
            throw new NoEntityClonedException($entity, $id);
        }

        $ids = $event->getIds();
        $newId = array_shift($ids);

        return new JsonResponse(['id' => $newId]);
    }
126980
public function CloneInstance()
	{
		$result = new FollowingNodeIterator();
		$result->AssignFrom( $this );
		$result->kind = $this->kind;
		return $result;
	}