Skip to content

Commit 0c2d388

Browse files
authored
Fix user:cleanup command (#104)
* Register "--delete" option for user:cleanup command * Use parameter to set value
1 parent 588b8c1 commit 0c2d388

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Command/UserCleanupCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ protected function configure() {
3030
->addOption('days', null, InputOption::VALUE_OPTIONAL, 'Interval days', false)
3131
->addOption('months', null, InputOption::VALUE_OPTIONAL, 'Interval month', false)
3232
->addOption('years', null, InputOption::VALUE_OPTIONAL, 'Interval years', false)
33+
->addOption('delete', null, InputOption::VALUE_NONE, 'Delete instead of deactivate')
3334
->addOption('confirm', null, InputOption::VALUE_NONE, 'Skip question')
3435
->addOption('minBalance', null, InputOption::VALUE_OPTIONAL, 'Minimum balance', false)
3536
->addOption('maxBalance', null, InputOption::VALUE_OPTIONAL, 'Maximum balance', false);
@@ -50,7 +51,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5051

5152
$queryBuilder
5253
->update(User::class, 'u')
53-
->set('u.disabled', 1);
54+
->set('u.disabled', ':disabled')
55+
->setParameter('disabled', true);
5456
}
5557

5658
if ($input->getOption('days') || $input->getOption('months') || $input->getOption('years')) {

0 commit comments

Comments
 (0)