Completed
Pull Request — master (#397)
by
unknown
02:23
created

ReindexCommandController::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * Reindex the event models.
5
 */
6
declare(strict_types=1);
7
8
namespace HDNET\Calendarize\Command;
9
10
use HDNET\Calendarize\Service\IndexerService;
11
use Symfony\Component\Console\Command\Command;
12
use Symfony\Component\Console\Input\InputInterface;
13
use Symfony\Component\Console\Output\OutputInterface;
14
use TYPO3\CMS\Core\Utility\GeneralUtility;
15
use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException;
16
use TYPO3\CMS\Extbase\Mvc\Exception\InvalidExtensionNameException;
17
use TYPO3\CMS\Extbase\Object\Exception;
18
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
19
20
/**
21
 * Reindex the event models.
22
 */
23
class ReindexCommandController extends Command
24
{
25
26
    /**
27
     * @return void
28
     */
29
    public function configure()
30
    {
31
        $this->setDescription('Calendarize: Reindex all events');
32
    }
33
34
    /**
35
     *
36
     * @param InputInterface $input
37
     * @param OutputInterface $output
38
     * @return int
39
     * @throws InvalidConfigurationTypeException
40
     * @throws InvalidExtensionNameException
41
     * @throws Exception
42
     * @throws InvalidQueryException
43
     */
44
    protected function execute(InputInterface $input, OutputInterface $output)
45
    {
46
        $indexer = GeneralUtility::makeInstance(IndexerService::class);
47
        $indexer->reindexAll();
48
49
        return 0;
50
    }
51
}
52