N98\Magento\Command\Cache\DisableCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | void
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return integer | void
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->detectMagento($output, true);
        if (!$this->initMagento()) {
            return;
        }
        $codeArgument = BinaryString::trimExplodeEmpty(',', $input->getArgument('code'));
        $this->saveCacheStatus($codeArgument, false);
        if (empty($codeArgument)) {
            $this->_getCacheModel()->flush();
        } else {
            foreach ($codeArgument as $type) {
                $this->_getCacheModel()->cleanType($type);
            }
        }
        if (count($codeArgument) > 0) {
            foreach ($codeArgument as $code) {
                $output->writeln('<info>Cache <comment>' . $code . '</comment> disabled</info>');
            }
        } else {
            $output->writeln('<info>Caches disabled</info>');
        }
    }
DisableCommand