src/Contao/Dca/Builder/Legacy/LegacyDcaDataDefinitionBuilder.php
protected function createCommandInstance($commandName, array &$commandDca)
    {
        switch ($commandName) {
            case 'cut':
                return new CutCommand();

            case 'copy':
            case 'deepcopy':
                return new CopyCommand();

            case 'all':
                return new SelectCommand();

            case 'toggle':
                $command = new ToggleCommand();

                if (isset($commandDca['toggleProperty'])) {
                    $command->setToggleProperty($commandDca['toggleProperty']);
                    unset($commandDca['toggleProperty']);
                } else {
                    // Implicit fallback to "published" as in Contao core.
                    $command->setToggleProperty('published');
                }

                if (isset($commandDca['toggleInverse'])) {
                    $command->setInverse($commandDca['toggleInverse']);
                    unset($commandDca['toggleInverse']);
                }

                return $command;
            default:
        }
        return new Command();
    }
protected function createCommandInstance($commandName, array &$commandDca)
    {
        switch ($commandName) {
            case 'cut':
                return new CutCommand();

            case 'copy':
            case 'deepcopy':
                return new CopyCommand();

            case 'all':
                return new SelectCommand();

            case 'toggle':
                $command = new ToggleCommand();

                if (isset($commandDca['toggleProperty'])) {
                    $command->setToggleProperty($commandDca['toggleProperty']);
                    unset($commandDca['toggleProperty']);
                } else {
                    // Implicit fallback to "published" as in Contao core.
                    $command->setToggleProperty('published');
                }

                if (isset($commandDca['toggleInverse'])) {
                    $command->setInverse($commandDca['toggleInverse']);
                    unset($commandDca['toggleInverse']);
                }

                return $command;
            default:
        }
        return new Command();
    }
protected function createCommandInstance ( $ commandName , array & $ commandDca ) { switch ( $ commandName ) { case 'cut' : return new CutCommand ( ) ; case 'copy' : case 'deepcopy' : return new CopyCommand ( ) ; case 'all' : return new SelectCommand ( ) ; case 'toggle' : $ command = new ToggleCommand ( ) ; if ( isset ( $ commandDca [ 'toggleProperty' ] ) ) { $ command -> setToggleProperty ( $ commandDca [ 'toggleProperty' ] ) ; unset ( $ commandDca [ 'toggleProperty' ] ) ; } else { // Implicit fallback to "published" as in Contao core. $ command -> setToggleProperty ( 'published' ) ; } if ( isset ( $ commandDca [ 'toggleInverse' ] ) ) { $ command -> setInverse ( $ commandDca [ 'toggleInverse' ] ) ; unset ( $ commandDca [ 'toggleInverse' ] ) ; } return $ command ; default : } return new Command ( ) ; }
Create the correct command instance for the given information.

@param string $commandName The name of the command to create.
@param array  $commandDca  The Dca information of the command.

@return CommandInterface
Create the correct command instance for the given information .