MetaModels\Item::varCopy PHP Метод

varCopy() публичный Метод

Additionally, the item will be a variant child of this item. NOTE: if this item is not a variant base itself, this item will return a item that is a child of this items variant base. i.e. exact clone.
public varCopy ( ) : MetaModels\IItem
Результат MetaModels\IItem the new copy.
    public function varCopy()
    {
        $objNewItem = $this->copy();
        // If this item is a variant base, we need to clean the variant base and set ourselves as the base.
        if ($this->isVariantBase()) {
            $objNewItem->set('vargroup', $this->get('id'));
            $objNewItem->set('varbase', '0');
        } else {
            $objNewItem->set('vargroup', $this->get('vargroup'));
            $objNewItem->set('varbase', '0');
        }
        return $objNewItem;
    }