private function cleanTables(InputInterface $input)
    {
        $aclOnly = true;
        if ($input->getOption('clean')) {
            $this->writeln('<info>Deleting current users and groups.</info>', OutputInterface::VERBOSITY_VERBOSE);

            if (OutputInterface::VERBOSITY_QUIET < $this->output->getVerbosity()) {
                $helper = $this->getHelper('question');
                $question = new ConfirmationQuestion('This will delete all existing users and groups, continue?', false, '/^(y)/i');

                if (!$helper->ask($input, $this->output, $question)) {
                    throw new \InvalidArgumentException('Aborted');
                }
            }

            $aclOnly = false;
        }

        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=0');
        foreach ($this->tables as $table) {
            if ($aclOnly && 'acl' !== substr($table, 0, 3)) {
                continue;
            }

            $this->em->getConnection()->executeQuery(sprintf('TRUNCATE `%s`', $table));
            $this->writeln(sprintf(' - Table `%s` truncated - <info>OK</info>', $table), OutputInterface::VERBOSITY_VERY_VERBOSE);
        }
        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=1');

        return $this;
    }
private function cleanTables(InputInterface $input)
    {
        $aclOnly = true;
        if ($input->getOption('clean')) {
            $this->writeln('<info>Deleting current users and groups.</info>', OutputInterface::VERBOSITY_VERBOSE);

            if (OutputInterface::VERBOSITY_QUIET < $this->output->getVerbosity()) {
                $helper = $this->getHelper('question');
                $question = new ConfirmationQuestion('This will delete all existing users and groups, continue?', false, '/^(y)/i');

                if (!$helper->ask($input, $this->output, $question)) {
                    throw new \InvalidArgumentException('Aborted');
                }
            }

            $aclOnly = false;
        }

        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=0');
        foreach ($this->tables as $table) {
            if ($aclOnly && 'acl' !== substr($table, 0, 3)) {
                continue;
            }

            $this->em->getConnection()->executeQuery(sprintf('TRUNCATE `%s`', $table));
            $this->writeln(sprintf(' - Table `%s` truncated - <info>OK</info>', $table), OutputInterface::VERBOSITY_VERY_VERBOSE);
        }
        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=1');

        return $this;
    }
private function cleanTables ( InputInterface $ input ) { $ aclOnly = true ; if ( $ input -> getOption ( 'clean' ) ) { $ this -> writeln ( '<info>Deleting current users and groups.</info>' , OutputInterface :: VERBOSITY_VERBOSE ) ; if ( OutputInterface :: VERBOSITY_QUIET < $ this -> output -> getVerbosity ( ) ) { $ helper = $ this -> getHelper ( 'question' ) ; $ question = new ConfirmationQuestion ( 'This will delete all existing users and groups, continue?' , false , '/^(y)/i' ) ; if ( ! $ helper -> ask ( $ input , $ this -> output , $ question ) ) { throw new \ InvalidArgumentException ( 'Aborted' ) ; } } $ aclOnly = false ; } $ this -> em -> getConnection ( ) -> executeUpdate ( 'SET FOREIGN_KEY_CHECKS=0' ) ; foreach ( $ this -> tables as $ table ) { if ( $ aclOnly && 'acl' !== substr ( $ table , 0 , 3 ) ) { continue ; } $ this -> em -> getConnection ( ) -> executeQuery ( sprintf ( 'TRUNCATE `%s`' , $ table ) ) ; $ this -> writeln ( sprintf ( ' - Table `%s` truncated - <info>OK</info>' , $ table ) , OutputInterface :: VERBOSITY_VERY_VERBOSE ) ; } $ this -> em -> getConnection ( ) -> executeUpdate ( 'SET FOREIGN_KEY_CHECKS=1' ) ; return $ this ; }
Cleans current users and rights if asked.

@param  InputInterface $input

@return UpdateUsersRightsCommand

@throws \InvalidArgumentException
Cleans current users and rights if asked .