Create duplicate

@return Mage_Catalog_Model_Product
191721
function duplicate()
    {
        $schema = VF_Singleton::getInstance()->schema();
        $vehicleFinder = new VF_Vehicle_Finder($schema);
        $leaf = $schema->getLeafLevel() . '_id';
        $newProduct = parent::duplicate();
        foreach ($this->getFits() as $fit) {
            print_r($fit);
            exit;
            $vehicle = $vehicleFinder->findByLeaf($fit->$leaf);
            $newProduct->insertMapping($vehicle);
        }
        if ($this->isUniversal()) {
            $newProduct->setUniversal(true);
        }
        return $newProduct;
    }
332104
public function CloneInstance()
	{
		$result = new PrecedingNodeIterator();
		$result->AssignFrom( $this );
		$result->kind = $this->kind;
		return $result;
	}
311644
public function create()
    {
        $instance = self::createFreeItemCoupon($this);
        $this->setId($instance->getId());
        return $instance;
    }
463851
public function duplicate() {
        $this->isNewRecord = true;

        foreach ($this->primaryKey() as $key) {
                    $this->$key = null;
        }

        if ($this->save()) {
            return $this;
        }
        return null;
    }
670719
public function CloneInstance()
	{
		$result = new SpecialDescendantNodeIterator();
		$result->AssignFrom( $this );
		$result->kind = $this->kind;
		return $result;
	}
797494
function createOrder()
    {
        // Make order
        $productCollectionID = $this->attribute( 'productcollection_id' );

        $user = eZUser::currentUser();
        $userID = $user->attribute( 'contentobject_id' );

        $time = time();
        $order = new eZOrder( array( 'productcollection_id' => $productCollectionID,
                                     'user_id' => $userID,
                                     'is_temporary' => 1,
                                     'created' => $time,
                                     'status_id' => eZOrderStatus::PENDING,
                                     'status_modified' => $time,
                                     'status_modifier_id' => $userID
                                     ) );

        $db = eZDB::instance();
        $db->begin();
        $order->store();

        $orderID = $order->attribute( 'id' );
        $this->setAttribute( 'order_id', $orderID );
        $this->store();
        $db->commit();

        return $order;
    }
1225046
public function createItem()
	{
		$context = $this->_getContext();
		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$values = array( 'siteid' => $context->getLocale()->getSiteId() );

		return $this->_createItem( $priceManager->createItem(), $values );
	}
590632
protected function cloneForExport()
    {
        return tap(new static, function ($instance) {
            $instance->setRawAttributes($this->getAttributes());
            $instance->setRelations($this->relations);
            $instance->setAppends($this->appends);
            $instance->setVisible($this->visible);
            $instance->setHidden($this->hidden);
        });
    }
241542
public function newInstance($cloned = array())
    {
        if ($cloned instanceof Model) {
            $cloned = $cloned->toArray(Model::FETCH_PUBLISHED);
        }

        if (isset($this->options['model'])) {
            $Model = $this->options['model'];
            return new $Model($cloned, array('collection' => $this));
        } else {
            return new Model($cloned, array('collection' => $this));
        }
    }
1323259
public function duplicate($id)
    {
        // Find the source item
        $src = $this->findOrFail($id);
        if (empty($src->cloneable)) {
            return App::abort(404);
        }

        // Duplicate using Bkwld\Cloner
        $new = $src->duplicate();

        // Don't make duplicates public
        if (array_key_exists('public', $new->getAttributes())) {
            $this->public = 0;
        }

        // If there is a name or title field, append " copy" to it.  Use "original"
        // to avoid mutators.
        if ($name = $new->getOriginal('name')) {
            $new->setAttribute('name', $name.' copy');
        } elseif ($title = $new->getOriginal('title')) {
            $new->setAttribute('title', $title.' copy');
        }

        // Set localization options on new instance
        if ($locale = request('locale')) {
            $new->locale = $locale;
            if (isset($src->locale_group)) {
                $new->locale_group = $src->locale_group;
            }
        }

        // Save any changes that were made
        $new->save();

        // Save the new record and redirect to its edit view
        return Redirect::to(DecoyURL::relative('edit', $new->getKey()))
            ->with('success', $this->successMessage($src, 'duplicated'));
    }
806724
protected function createModel()
    {
        $model = parent::createModel();

        $model->addColumn('CONCAT(gr2t_completed, \'' . $this->_(' of ') . '\', gr2t_count)', 'progress');
        $model->set('progress', 'label', $this->_('Progress'), 'tdClass', 'rightAlign', 'thClass', 'rightAlign');

        return $model;
    }
229641
public function CloneInstance()
	{
		$result = new ChildNodeIterator();
		$result->AssignFrom( $this );
		$result->excludeComments = $this->excludeComments;
		$result->excludeWhitespace = $this->excludeWhitespace;
		return $result;
	}
842783
public function copy(): self
    {
        $stockMovement = new static();
        $stockMovement
            ->setQuantity($this->getQuantity())
            ->setComplaint($this->isComplaint())
            ->setReference($this->getReference())
            ->setRetailPrice($this->getRetailPrice())
            ->setPrice($this->getPrice())
            ->setVatPercentage($this->getVatPercentage())
            ->setType($this->getType())
            ->setProduct($this->getProduct())
            ->setOrderLine($this->getOrderLine())
            ->setOrderLineRemoved($this->isOrderLineRemoved())
        ;

        return $stockMovement;
    }
747584
public function create()
    {
        $instance = self::createCustomer($this);
        $this->setId($instance->getId());
        return $instance;
    }
801384
public function create()
    {
        $instance = self::createCustomerGroup($this);
        $this->setId($instance->getId());
        return $instance;
    }
818499
public function CloneInstance()
	{
		$result = new SpecialChildNodeIterator();
		$result->AssignFrom( $this );
		$result->kind = $this->kind;
		return $result;
	}
621498
public function create(): Model
	{
		$model_class = $this->getModelClass();
		$instance = new $model_class;
		$this->fill($instance);

		return $instance;
	}