Class CopyModelController handles copy action on a model.

It provides a setEnvironment method which has to be used to initialize the environment instead.

 Methods

Copy a model by using.

copy(\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $modelId) : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

{@inheritdoc}

process() 

Check if is it allowed to create a new record. This is necessary to create the copy.

guardIsCreatable(\ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $modelId, bool $redirect) : void

Parameters

$redirect

bool

If true it redirects to error page instead of throwing an exception.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Exception\NotCreatableException If deletion is disabled.

Redirect to edit mask.

redirect(\ContaoCommunityAlliance\DcGeneral\EnvironmentInterface $environment, \ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface $copiedModelId) : void