protected function guardIsCreatable(EnvironmentInterface $environment, ModelIdInterface $modelId, $redirect = false)
    {
        $dataDefinition = $environment->getDataDefinition();
        if ($dataDefinition->getBasicDefinition()->isCreatable()) {
            return;
        }

        if ($redirect) {
            $eventDispatcher = $environment->getEventDispatcher();

            $eventDispatcher->dispatch(
                ContaoEvents::SYSTEM_LOG,
                new LogEvent(
                    \sprintf(
                        'Table "%s" is not creatable, DC_General - DefaultController - copy()',
                        $dataDefinition->getName()
                    ),
                    __CLASS__ . '::delete()',
                    TL_ERROR
                )
            );

            $eventDispatcher->dispatch(
                ContaoEvents::CONTROLLER_REDIRECT,
                new RedirectEvent('contao?act=error')
            );
        }

        throw new NotCreatableException($modelId->getDataProviderName());
    }