Skip to content

Duplicate reference

Inherit Options

groups

type: string|string[]

Set groups where duplicate type is available.

Clone

Use native keyword clone for duplication.

Typeclone
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\CloneDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Inherit Optionsgroups

Collection

Create a new collection or array and duplicate all items from old collection into the new collection. Use this type if you want to make a deep copy of a collection.

Typecollection
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\CollectionDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Optionsmap_target, by_reference
Inherit Optionsgroups

by_reference

type: bool default: false

When adding an item to the new collection, the add function of the parent will be used instead of the add function of the collection.

php
// by_reference is false
$newCollection->add($newItem);
$parent->setCollection($newCollection)

// by_reference is true
$parent->addItem($newItem)

map_target

type: bool default: false

If you duplicate to a target collection and map_target is true, then it will also call a duplicate to the target at the same index position.

Collection reference

Copy the reference of a collection. If the duplicate has a target, then the items of the original collection will be added or deleted to transform into the source collection.

Typecollection_reference
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\CollectionReferenceDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Inherit Optionsgroups

Datetime

Duplicate a DateTime object.

Typedatetime
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\DateTimeDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Inherit Optionsgroups

File

Duplicate a media File object or a collection of it.

Typefile
ClassEnhavo\Bundle\MediaBundle\Duplicate\Type\FileDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Inherit Optionsgroups

Model

A new copy of an object.

Typemodel
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\ModelDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Inherit Optionsgroups

Property

Duplicate a scalar or array.

Typeproperty
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\PropertyDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Inherit Optionsgroups

Reference

Use the same reference for an object.

Typereference
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\ReferenceDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Inherit Optionsgroups

String

Copy a string.

Typestring
ClassEnhavo\Bundle\ResourceBundle\Duplicate\Type\CloneDuplicateType
ParentEnhavo\Bundle\ResourceBundle\Duplicate\BaseActionType
Optionsprefixpostfixtranslation_domain
Inherit Optionsgroups

prefix

type: string default: null

Add a string at the beginning of the duplicated string.

postfix

type: string default: null

Add a string at the end of the duplicated string.

translation_domain

type: string default: null

Translation domain for pre- and postfix.