src/Contao/View/Contao2BackendView/EditMask.php
protected function checkCreatable($model)
    {
        $environment = $this->getEnvironment();
        $definition  = $this->getDataDefinition();

        // Check if table is closed but we are adding a new item.
        if (!($model->getId() || $definition->getBasicDefinition()->isCreatable())) {
            $message = 'DataContainer ' . $definition->getName() . ' is closed';
            $environment->getEventDispatcher()->dispatch(
                ContaoEvents::SYSTEM_LOG,
                new LogEvent($message, TL_ERROR, 'DC_General - edit()')
            );
            throw new DcGeneralRuntimeException($message);
        }
    }
protected function checkCreatable($model)
    {
        $environment = $this->getEnvironment();
        $definition  = $this->getDataDefinition();

        // Check if table is closed but we are adding a new item.
        if (!($model->getId() || $definition->getBasicDefinition()->isCreatable())) {
            $message = 'DataContainer ' . $definition->getName() . ' is closed';
            $environment->getEventDispatcher()->dispatch(
                ContaoEvents::SYSTEM_LOG,
                new LogEvent($message, TL_ERROR, 'DC_General - edit()')
            );
            throw new DcGeneralRuntimeException($message);
        }
    }
protected function checkCreatable ( $ model ) { $ environment = $ this -> getEnvironment ( ) ; $ definition = $ this -> getDataDefinition ( ) ; // Check if table is closed but we are adding a new item. if ( ! ( $ model -> getId ( ) || $ definition -> getBasicDefinition ( ) -> isCreatable ( ) ) ) { $ message = 'DataContainer ' . $ definition -> getName ( ) . ' is closed' ; $ environment -> getEventDispatcher ( ) -> dispatch ( ContaoEvents :: SYSTEM_LOG , new LogEvent ( $ message , TL_ERROR , 'DC_General - edit()' ) ) ; throw new DcGeneralRuntimeException ( $ message ) ; } }
Ensure the view is editable and throw an Exception if not.

@param ModelInterface $model The model to be edited, if this is given, we are not in create mode.

@return void

@throws DcGeneralRuntimeException When the definition is not editable.
Ensure the view is editable and throw an Exception if not .